diff options
| author | Abderrahmane Benbachir <abderrahmane.benbachir@polymtl.ca> | 2018-03-22 20:33:28 -0400 |
|---|---|---|
| committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-04-06 08:56:55 -0400 |
| commit | 58eacfffc41735c9155becc73cb7f4dcc60a46a9 (patch) | |
| tree | 91c31d03ea18b827060687d4cc6d61600e6f4504 | |
| parent | 4ee7c60de83ac01fa4c33c55937357601631e8ad (diff) | |
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/1521765208.19745.2.camel@polymtl.ca
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Abderrahmane Benbachir <abderrahmane.benbachir@polymtl.ca>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
| -rw-r--r-- | kernel/printk/printk.c | 7 | ||||
| -rw-r--r-- | security/security.c | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index f274fbef821d..cb5b35341d69 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
| @@ -52,6 +52,7 @@ | |||
| 52 | #include <linux/uaccess.h> | 52 | #include <linux/uaccess.h> |
| 53 | #include <asm/sections.h> | 53 | #include <asm/sections.h> |
| 54 | 54 | ||
| 55 | #include <trace/events/initcall.h> | ||
| 55 | #define CREATE_TRACE_POINTS | 56 | #define CREATE_TRACE_POINTS |
| 56 | #include <trace/events/printk.h> | 57 | #include <trace/events/printk.h> |
| 57 | 58 | ||
| @@ -2781,6 +2782,7 @@ EXPORT_SYMBOL(unregister_console); | |||
| 2781 | */ | 2782 | */ |
| 2782 | void __init console_init(void) | 2783 | void __init console_init(void) |
| 2783 | { | 2784 | { |
| 2785 | int ret; | ||
| 2784 | initcall_t *call; | 2786 | initcall_t *call; |
| 2785 | 2787 | ||
| 2786 | /* Setup the default TTY line discipline. */ | 2788 | /* Setup the default TTY line discipline. */ |
| @@ -2791,8 +2793,11 @@ void __init console_init(void) | |||
| 2791 | * inform about problems etc.. | 2793 | * inform about problems etc.. |
| 2792 | */ | 2794 | */ |
| 2793 | call = __con_initcall_start; | 2795 | call = __con_initcall_start; |
| 2796 | trace_initcall_level("console"); | ||
| 2794 | while (call < __con_initcall_end) { | 2797 | while (call < __con_initcall_end) { |
| 2795 | (*call)(); | 2798 | trace_initcall_start((*call)); |
| 2799 | ret = (*call)(); | ||
| 2800 | trace_initcall_finish((*call), ret); | ||
| 2796 | call++; | 2801 | call++; |
| 2797 | } | 2802 | } |
| 2798 | } | 2803 | } |
diff --git a/security/security.c b/security/security.c index 1cd8526cb0b7..987afe3d464c 100644 --- a/security/security.c +++ b/security/security.c | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | #include <linux/string.h> | 30 | #include <linux/string.h> |
| 31 | #include <net/flow.h> | 31 | #include <net/flow.h> |
| 32 | 32 | ||
| 33 | #include <trace/events/initcall.h> | ||
| 34 | |||
| 33 | #define MAX_LSM_EVM_XATTR 2 | 35 | #define MAX_LSM_EVM_XATTR 2 |
| 34 | 36 | ||
| 35 | /* Maximum number of letters for an LSM name string */ | 37 | /* Maximum number of letters for an LSM name string */ |
| @@ -45,10 +47,14 @@ static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] = | |||
| 45 | 47 | ||
| 46 | static void __init do_security_initcalls(void) | 48 | static void __init do_security_initcalls(void) |
| 47 | { | 49 | { |
| 50 | int ret; | ||
| 48 | initcall_t *call; | 51 | initcall_t *call; |
| 49 | call = __security_initcall_start; | 52 | call = __security_initcall_start; |
| 53 | trace_initcall_level("security"); | ||
| 50 | while (call < __security_initcall_end) { | 54 | while (call < __security_initcall_end) { |
| 51 | (*call) (); | 55 | trace_initcall_start((*call)); |
| 56 | ret = (*call) (); | ||
| 57 | trace_initcall_finish((*call), ret); | ||
| 52 | call++; | 58 | call++; |
| 53 | } | 59 | } |
| 54 | } | 60 | } |
