Skip to content

Commit

Permalink
init, tracing: instrument security and console initcall trace events
Browse files Browse the repository at this point in the history
Trace events have been added around the initcall functions defined in
init/main.c. But console and security have their own initcalls. This adds
the trace events associated for those initcall functions.

Link: http://lkml.kernel.org/r/[email protected]

Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Abderrahmane Benbachir <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
  • Loading branch information
abenbachir authored and rostedt committed Apr 6, 2018
1 parent 4ee7c60 commit 58eacff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion kernel/printk/printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <linux/uaccess.h>
#include <asm/sections.h>

#include <trace/events/initcall.h>
#define CREATE_TRACE_POINTS
#include <trace/events/printk.h>

Expand Down Expand Up @@ -2781,6 +2782,7 @@ EXPORT_SYMBOL(unregister_console);
*/
void __init console_init(void)
{
int ret;
initcall_t *call;

/* Setup the default TTY line discipline. */
Expand All @@ -2791,8 +2793,11 @@ void __init console_init(void)
* inform about problems etc..
*/
call = __con_initcall_start;
trace_initcall_level("console");
while (call < __con_initcall_end) {
(*call)();
trace_initcall_start((*call));
ret = (*call)();
trace_initcall_finish((*call), ret);
call++;
}
}
Expand Down
8 changes: 7 additions & 1 deletion security/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <linux/string.h>
#include <net/flow.h>

#include <trace/events/initcall.h>

#define MAX_LSM_EVM_XATTR 2

/* Maximum number of letters for an LSM name string */
Expand All @@ -45,10 +47,14 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =

static void __init do_security_initcalls(void)
{
int ret;
initcall_t *call;
call = __security_initcall_start;
trace_initcall_level("security");
while (call < __security_initcall_end) {
(*call) ();
trace_initcall_start((*call));
ret = (*call) ();
trace_initcall_finish((*call), ret);
call++;
}
}
Expand Down

0 comments on commit 58eacff

Please sign in to comment.