diff options
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r-- | kernel/trace/trace_syscalls.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index b706529b4fc7..5c9fe08d2093 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -55,20 +55,21 @@ struct ftrace_event_class event_class_syscall_exit = { | |||
55 | .raw_init = init_syscall_trace, | 55 | .raw_init = init_syscall_trace, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | extern unsigned long __start_syscalls_metadata[]; | 58 | extern struct syscall_metadata *__start_syscalls_metadata[]; |
59 | extern unsigned long __stop_syscalls_metadata[]; | 59 | extern struct syscall_metadata *__stop_syscalls_metadata[]; |
60 | 60 | ||
61 | static struct syscall_metadata **syscalls_metadata; | 61 | static struct syscall_metadata **syscalls_metadata; |
62 | 62 | ||
63 | static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | 63 | static __init struct syscall_metadata * |
64 | find_syscall_meta(unsigned long syscall) | ||
64 | { | 65 | { |
65 | struct syscall_metadata *start; | 66 | struct syscall_metadata **start; |
66 | struct syscall_metadata *stop; | 67 | struct syscall_metadata **stop; |
67 | char str[KSYM_SYMBOL_LEN]; | 68 | char str[KSYM_SYMBOL_LEN]; |
68 | 69 | ||
69 | 70 | ||
70 | start = (struct syscall_metadata *)__start_syscalls_metadata; | 71 | start = __start_syscalls_metadata; |
71 | stop = (struct syscall_metadata *)__stop_syscalls_metadata; | 72 | stop = __stop_syscalls_metadata; |
72 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); | 73 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); |
73 | 74 | ||
74 | for ( ; start < stop; start++) { | 75 | for ( ; start < stop; start++) { |
@@ -78,8 +79,8 @@ static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | |||
78 | * with "SyS" instead of "sys", leading to an unwanted | 79 | * with "SyS" instead of "sys", leading to an unwanted |
79 | * mismatch. | 80 | * mismatch. |
80 | */ | 81 | */ |
81 | if (start->name && !strcmp(start->name + 3, str + 3)) | 82 | if ((*start)->name && !strcmp((*start)->name + 3, str + 3)) |
82 | return start; | 83 | return *start; |
83 | } | 84 | } |
84 | return NULL; | 85 | return NULL; |
85 | } | 86 | } |