Skip to content

Commit 58eacff

Browse files
abenbachirrostedt
authored andcommitted
init, tracing: instrument security and console initcall trace events
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]>
1 parent 4ee7c60 commit 58eacff

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

kernel/printk/printk.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <linux/uaccess.h>
5353
#include <asm/sections.h>
5454

55+
#include <trace/events/initcall.h>
5556
#define CREATE_TRACE_POINTS
5657
#include <trace/events/printk.h>
5758

@@ -2781,6 +2782,7 @@ EXPORT_SYMBOL(unregister_console);
27812782
*/
27822783
void __init console_init(void)
27832784
{
2785+
int ret;
27842786
initcall_t *call;
27852787

27862788
/* Setup the default TTY line discipline. */
@@ -2791,8 +2793,11 @@ void __init console_init(void)
27912793
* inform about problems etc..
27922794
*/
27932795
call = __con_initcall_start;
2796+
trace_initcall_level("console");
27942797
while (call < __con_initcall_end) {
2795-
(*call)();
2798+
trace_initcall_start((*call));
2799+
ret = (*call)();
2800+
trace_initcall_finish((*call), ret);
27962801
call++;
27972802
}
27982803
}

security/security.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
#include <linux/string.h>
3131
#include <net/flow.h>
3232

33+
#include <trace/events/initcall.h>
34+
3335
#define MAX_LSM_EVM_XATTR 2
3436

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

4648
static void __init do_security_initcalls(void)
4749
{
50+
int ret;
4851
initcall_t *call;
4952
call = __security_initcall_start;
53+
trace_initcall_level("security");
5054
while (call < __security_initcall_end) {
51-
(*call) ();
55+
trace_initcall_start((*call));
56+
ret = (*call) ();
57+
trace_initcall_finish((*call), ret);
5258
call++;
5359
}
5460
}

0 commit comments

Comments
 (0)