diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-02-15 04:24:31 -0500 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-02-15 04:24:31 -0500 |
| commit | 0a9d59a2461477bd9ed143c01af9df3f8f00fa81 (patch) | |
| tree | df997d1cfb0786427a0df1fbd6f0640fa4248cf4 /kernel/trace | |
| parent | a23ce6da9677d245aa0aadc99f4197030350ab54 (diff) | |
| parent | 795abaf1e4e188c4171e3cd3dbb11a9fcacaf505 (diff) | |
Merge branch 'master' into for-next
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_irqsoff.c | 8 | ||||
| -rw-r--r-- | kernel/trace/trace_syscalls.c | 52 |
5 files changed, 38 insertions, 47 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_irqsoff.c b/kernel/trace/trace_irqsoff.c index 5cf8c602b880..92b6e1e12d98 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c | |||
| @@ -453,14 +453,6 @@ void time_hardirqs_off(unsigned long a0, unsigned long a1) | |||
| 453 | * Stubs: | 453 | * Stubs: |
| 454 | */ | 454 | */ |
| 455 | 455 | ||
| 456 | void early_boot_irqs_off(void) | ||
| 457 | { | ||
| 458 | } | ||
| 459 | |||
| 460 | void early_boot_irqs_on(void) | ||
| 461 | { | ||
| 462 | } | ||
| 463 | |||
| 464 | void trace_softirqs_on(unsigned long ip) | 456 | void trace_softirqs_on(unsigned long ip) |
| 465 | { | 457 | { |
| 466 | } | 458 | } |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index bac752f0cfb5..5c9fe08d2093 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
| @@ -23,9 +23,6 @@ static int syscall_exit_register(struct ftrace_event_call *event, | |||
| 23 | static int syscall_enter_define_fields(struct ftrace_event_call *call); | 23 | static int syscall_enter_define_fields(struct ftrace_event_call *call); |
| 24 | static int syscall_exit_define_fields(struct ftrace_event_call *call); | 24 | static int syscall_exit_define_fields(struct ftrace_event_call *call); |
| 25 | 25 | ||
| 26 | /* All syscall exit events have the same fields */ | ||
| 27 | static LIST_HEAD(syscall_exit_fields); | ||
| 28 | |||
| 29 | static struct list_head * | 26 | static struct list_head * |
| 30 | syscall_get_enter_fields(struct ftrace_event_call *call) | 27 | syscall_get_enter_fields(struct ftrace_event_call *call) |
| 31 | { | 28 | { |
| @@ -34,50 +31,45 @@ syscall_get_enter_fields(struct ftrace_event_call *call) | |||
| 34 | return &entry->enter_fields; | 31 | return &entry->enter_fields; |
| 35 | } | 32 | } |
| 36 | 33 | ||
| 37 | static struct list_head * | ||
| 38 | syscall_get_exit_fields(struct ftrace_event_call *call) | ||
| 39 | { | ||
| 40 | return &syscall_exit_fields; | ||
| 41 | } | ||
| 42 | |||
| 43 | struct trace_event_functions enter_syscall_print_funcs = { | 34 | struct trace_event_functions enter_syscall_print_funcs = { |
| 44 | .trace = print_syscall_enter, | 35 | .trace = print_syscall_enter, |
| 45 | }; | 36 | }; |
| 46 | 37 | ||
| 47 | struct trace_event_functions exit_syscall_print_funcs = { | 38 | struct trace_event_functions exit_syscall_print_funcs = { |
| 48 | .trace = print_syscall_exit, | 39 | .trace = print_syscall_exit, |
| 49 | }; | 40 | }; |
| 50 | 41 | ||
| 51 | struct ftrace_event_class event_class_syscall_enter = { | 42 | struct ftrace_event_class event_class_syscall_enter = { |
| 52 | .system = "syscalls", | 43 | .system = "syscalls", |
| 53 | .reg = syscall_enter_register, | 44 | .reg = syscall_enter_register, |
| 54 | .define_fields = syscall_enter_define_fields, | 45 | .define_fields = syscall_enter_define_fields, |
| 55 | .get_fields = syscall_get_enter_fields, | 46 | .get_fields = syscall_get_enter_fields, |
| 56 | .raw_init = init_syscall_trace, | 47 | .raw_init = init_syscall_trace, |
| 57 | }; | 48 | }; |
| 58 | 49 | ||
| 59 | struct ftrace_event_class event_class_syscall_exit = { | 50 | struct ftrace_event_class event_class_syscall_exit = { |
| 60 | .system = "syscalls", | 51 | .system = "syscalls", |
| 61 | .reg = syscall_exit_register, | 52 | .reg = syscall_exit_register, |
| 62 | .define_fields = syscall_exit_define_fields, | 53 | .define_fields = syscall_exit_define_fields, |
| 63 | .get_fields = syscall_get_exit_fields, | 54 | .fields = LIST_HEAD_INIT(event_class_syscall_exit.fields), |
| 64 | .raw_init = init_syscall_trace, | 55 | .raw_init = init_syscall_trace, |
| 65 | }; | 56 | }; |
| 66 | 57 | ||
| 67 | extern unsigned long __start_syscalls_metadata[]; | 58 | extern struct syscall_metadata *__start_syscalls_metadata[]; |
| 68 | extern unsigned long __stop_syscalls_metadata[]; | 59 | extern struct syscall_metadata *__stop_syscalls_metadata[]; |
| 69 | 60 | ||
| 70 | static struct syscall_metadata **syscalls_metadata; | 61 | static struct syscall_metadata **syscalls_metadata; |
| 71 | 62 | ||
| 72 | static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | 63 | static __init struct syscall_metadata * |
| 64 | find_syscall_meta(unsigned long syscall) | ||
| 73 | { | 65 | { |
| 74 | struct syscall_metadata *start; | 66 | struct syscall_metadata **start; |
| 75 | struct syscall_metadata *stop; | 67 | struct syscall_metadata **stop; |
| 76 | char str[KSYM_SYMBOL_LEN]; | 68 | char str[KSYM_SYMBOL_LEN]; |
| 77 | 69 | ||
| 78 | 70 | ||
| 79 | start = (struct syscall_metadata *)__start_syscalls_metadata; | 71 | start = __start_syscalls_metadata; |
| 80 | stop = (struct syscall_metadata *)__stop_syscalls_metadata; | 72 | stop = __stop_syscalls_metadata; |
| 81 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); | 73 | kallsyms_lookup(syscall, NULL, NULL, NULL, str); |
| 82 | 74 | ||
| 83 | for ( ; start < stop; start++) { | 75 | for ( ; start < stop; start++) { |
| @@ -87,8 +79,8 @@ static struct syscall_metadata *find_syscall_meta(unsigned long syscall) | |||
| 87 | * with "SyS" instead of "sys", leading to an unwanted | 79 | * with "SyS" instead of "sys", leading to an unwanted |
| 88 | * mismatch. | 80 | * mismatch. |
| 89 | */ | 81 | */ |
| 90 | if (start->name && !strcmp(start->name + 3, str + 3)) | 82 | if ((*start)->name && !strcmp((*start)->name + 3, str + 3)) |
| 91 | return start; | 83 | return *start; |
| 92 | } | 84 | } |
| 93 | return NULL; | 85 | return NULL; |
| 94 | } | 86 | } |
