diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/blktrace.c | 7 | ||||
| -rw-r--r-- | kernel/trace/trace_events.c | 12 | ||||
| -rw-r--r-- | kernel/trace/trace_export.c | 6 | ||||
| -rw-r--r-- | kernel/trace/trace_syscalls.c | 19 |
4 files changed, 26 insertions, 18 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 153562d0b93c..d95721f33702 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
| @@ -138,6 +138,13 @@ void __trace_note_message(struct blk_trace *bt, const char *fmt, ...) | |||
| 138 | !blk_tracer_enabled)) | 138 | !blk_tracer_enabled)) |
| 139 | return; | 139 | return; |
| 140 | 140 | ||
| 141 | /* | ||
| 142 | * If the BLK_TC_NOTIFY action mask isn't set, don't send any note | ||
| 143 | * message to the trace. | ||
| 144 | */ | ||
| 145 | if (!(bt->act_mask & BLK_TC_NOTIFY)) | ||
| 146 | return; | ||
| 147 | |||
| 141 | local_irq_save(flags); | 148 | local_irq_save(flags); |
| 142 | buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); | 149 | buf = per_cpu_ptr(bt->msg_data, smp_processor_id()); |
| 143 | va_start(args, fmt); | 150 | va_start(args, fmt); |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 35fde09b81de..5f499e0438a4 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
| @@ -1284,7 +1284,7 @@ trace_create_file_ops(struct module *mod) | |||
| 1284 | static void trace_module_add_events(struct module *mod) | 1284 | static void trace_module_add_events(struct module *mod) |
| 1285 | { | 1285 | { |
| 1286 | struct ftrace_module_file_ops *file_ops = NULL; | 1286 | struct ftrace_module_file_ops *file_ops = NULL; |
| 1287 | struct ftrace_event_call *call, *start, *end; | 1287 | struct ftrace_event_call **call, **start, **end; |
| 1288 | 1288 | ||
| 1289 | start = mod->trace_events; | 1289 | start = mod->trace_events; |
| 1290 | end = mod->trace_events + mod->num_trace_events; | 1290 | end = mod->trace_events + mod->num_trace_events; |
| @@ -1297,7 +1297,7 @@ static void trace_module_add_events(struct module *mod) | |||
| 1297 | return; | 1297 | return; |
| 1298 | 1298 | ||
| 1299 | for_each_event(call, start, end) { | 1299 | for_each_event(call, start, end) { |
| 1300 | __trace_add_event_call(call, mod, | 1300 | __trace_add_event_call(*call, mod, |
| 1301 | &file_ops->id, &file_ops->enable, | 1301 | &file_ops->id, &file_ops->enable, |
| 1302 | &file_ops->filter, &file_ops->format); | 1302 | &file_ops->filter, &file_ops->format); |
| 1303 | } | 1303 | } |
| @@ -1367,8 +1367,8 @@ static struct notifier_block trace_module_nb = { | |||
| 1367 | .priority = 0, | 1367 | .priority = 0, |
| 1368 | }; | 1368 | }; |
| 1369 | 1369 | ||
| 1370 | extern struct ftrace_event_call __start_ftrace_events[]; | 1370 | extern struct ftrace_event_call *__start_ftrace_events[]; |
| 1371 | extern struct ftrace_event_call __stop_ftrace_events[]; | 1371 | extern struct ftrace_event_call *__stop_ftrace_events[]; |
| 1372 | 1372 | ||
| 1373 | static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata; | 1373 | static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata; |
| 1374 | 1374 | ||
| @@ -1384,7 +1384,7 @@ __setup("trace_event=", setup_trace_event); | |||
| 1384 | 1384 | ||
| 1385 | static __init int event_trace_init(void) | 1385 | static __init int event_trace_init(void) |
| 1386 | { | 1386 | { |
| 1387 | struct ftrace_event_call *call; | 1387 | struct ftrace_event_call **call; |
| 1388 | struct dentry *d_tracer; | 1388 | struct dentry *d_tracer; |
| 1389 | struct dentry *entry; | 1389 | struct dentry *entry; |
| 1390 | struct dentry *d_events; | 1390 | struct dentry *d_events; |
| @@ -1430,7 +1430,7 @@ static __init int event_trace_init(void) | |||
| 1430 | pr_warning("tracing: Failed to allocate common fields"); | 1430 | pr_warning("tracing: Failed to allocate common fields"); |
| 1431 | 1431 | ||
| 1432 | for_each_event(call, __start_ftrace_events, __stop_ftrace_events) { | 1432 | for_each_event(call, __start_ftrace_events, __stop_ftrace_events) { |
| 1433 | __trace_add_event_call(call, NULL, &ftrace_event_id_fops, | 1433 | __trace_add_event_call(*call, NULL, &ftrace_event_id_fops, |
| 1434 | &ftrace_enable_fops, | 1434 | &ftrace_enable_fops, |
| 1435 | &ftrace_event_filter_fops, | 1435 | &ftrace_event_filter_fops, |
| 1436 | &ftrace_event_format_fops); | 1436 | &ftrace_event_format_fops); |
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 4b74d71705c0..bbeec31e0ae3 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
| @@ -161,13 +161,13 @@ struct ftrace_event_class event_class_ftrace_##call = { \ | |||
| 161 | .fields = LIST_HEAD_INIT(event_class_ftrace_##call.fields),\ | 161 | .fields = LIST_HEAD_INIT(event_class_ftrace_##call.fields),\ |
| 162 | }; \ | 162 | }; \ |
| 163 | \ | 163 | \ |
| 164 | struct ftrace_event_call __used \ | 164 | struct ftrace_event_call __used event_##call = { \ |
| 165 | __attribute__((__aligned__(4))) \ | ||
| 166 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
| 167 | .name = #call, \ | 165 | .name = #call, \ |
| 168 | .event.type = etype, \ | 166 | .event.type = etype, \ |
| 169 | .class = &event_class_ftrace_##call, \ | 167 | .class = &event_class_ftrace_##call, \ |
| 170 | .print_fmt = print, \ | 168 | .print_fmt = print, \ |
| 171 | }; \ | 169 | }; \ |
| 170 | struct ftrace_event_call __used \ | ||
| 171 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; | ||
| 172 | 172 | ||
| 173 | #include "trace_entries.h" | 173 | #include "trace_entries.h" |
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 | } |
