diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-11-11 02:19:37 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-11-11 02:19:37 -0500 |
commit | efc96737bd82b508794d2b28061a12af4a3f7766 (patch) | |
tree | e9fe4982967b74c0d25a35a2d7f7c62d8be98a47 | |
parent | 1ec454baf1245df4fdb5dae728da3363630ce6de (diff) | |
parent | 7e9a49ef542610609144d1afcd516dc3fafac4d6 (diff) |
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace into perf/core
-rw-r--r-- | Documentation/trace/events.txt | 2 | ||||
-rw-r--r-- | include/linux/ftrace_event.h | 2 | ||||
-rw-r--r-- | kernel/jump_label.c | 3 | ||||
-rw-r--r-- | kernel/lockdep.c | 30 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 5 | ||||
-rw-r--r-- | kernel/trace/trace.c | 15 | ||||
-rw-r--r-- | kernel/trace/trace.h | 1 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 1 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 33 | ||||
-rw-r--r-- | kernel/trace/trace_irqsoff.c | 13 | ||||
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 13 | ||||
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 2 |
12 files changed, 87 insertions, 33 deletions
diff --git a/Documentation/trace/events.txt b/Documentation/trace/events.txt index b510564aac7e..bb24c2a0e870 100644 --- a/Documentation/trace/events.txt +++ b/Documentation/trace/events.txt | |||
@@ -191,8 +191,6 @@ And for string fields they are: | |||
191 | 191 | ||
192 | Currently, only exact string matches are supported. | 192 | Currently, only exact string matches are supported. |
193 | 193 | ||
194 | Currently, the maximum number of predicates in a filter is 16. | ||
195 | |||
196 | 5.2 Setting filters | 194 | 5.2 Setting filters |
197 | ------------------- | 195 | ------------------- |
198 | 196 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 96efa6794ea5..c3da42dd22ba 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -172,6 +172,7 @@ enum { | |||
172 | TRACE_EVENT_FL_FILTERED_BIT, | 172 | TRACE_EVENT_FL_FILTERED_BIT, |
173 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 173 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
174 | TRACE_EVENT_FL_CAP_ANY_BIT, | 174 | TRACE_EVENT_FL_CAP_ANY_BIT, |
175 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, | ||
175 | }; | 176 | }; |
176 | 177 | ||
177 | enum { | 178 | enum { |
@@ -179,6 +180,7 @@ enum { | |||
179 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), | 180 | TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT), |
180 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 181 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
181 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | 182 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), |
183 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), | ||
182 | }; | 184 | }; |
183 | 185 | ||
184 | struct ftrace_event_call { | 186 | struct ftrace_event_call { |
diff --git a/kernel/jump_label.c b/kernel/jump_label.c index bbdfe2a462a0..66ff7109f697 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c | |||
@@ -66,8 +66,9 @@ void jump_label_inc(struct jump_label_key *key) | |||
66 | return; | 66 | return; |
67 | 67 | ||
68 | jump_label_lock(); | 68 | jump_label_lock(); |
69 | if (atomic_add_return(1, &key->enabled) == 1) | 69 | if (atomic_read(&key->enabled) == 0) |
70 | jump_label_update(key, JUMP_LABEL_ENABLE); | 70 | jump_label_update(key, JUMP_LABEL_ENABLE); |
71 | atomic_inc(&key->enabled); | ||
71 | jump_label_unlock(); | 72 | jump_label_unlock(); |
72 | } | 73 | } |
73 | 74 | ||
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index e69434b070da..d2fab46a1c94 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -498,36 +498,32 @@ void get_usage_chars(struct lock_class *class, char usage[LOCK_USAGE_CHARS]) | |||
498 | usage[i] = '\0'; | 498 | usage[i] = '\0'; |
499 | } | 499 | } |
500 | 500 | ||
501 | static int __print_lock_name(struct lock_class *class) | 501 | static void __print_lock_name(struct lock_class *class) |
502 | { | 502 | { |
503 | char str[KSYM_NAME_LEN]; | 503 | char str[KSYM_NAME_LEN]; |
504 | const char *name; | 504 | const char *name; |
505 | 505 | ||
506 | name = class->name; | 506 | name = class->name; |
507 | if (!name) | ||
508 | name = __get_key_name(class->key, str); | ||
509 | |||
510 | return printk("%s", name); | ||
511 | } | ||
512 | |||
513 | static void print_lock_name(struct lock_class *class) | ||
514 | { | ||
515 | char str[KSYM_NAME_LEN], usage[LOCK_USAGE_CHARS]; | ||
516 | const char *name; | ||
517 | |||
518 | get_usage_chars(class, usage); | ||
519 | |||
520 | name = class->name; | ||
521 | if (!name) { | 507 | if (!name) { |
522 | name = __get_key_name(class->key, str); | 508 | name = __get_key_name(class->key, str); |
523 | printk(" (%s", name); | 509 | printk("%s", name); |
524 | } else { | 510 | } else { |
525 | printk(" (%s", name); | 511 | printk("%s", name); |
526 | if (class->name_version > 1) | 512 | if (class->name_version > 1) |
527 | printk("#%d", class->name_version); | 513 | printk("#%d", class->name_version); |
528 | if (class->subclass) | 514 | if (class->subclass) |
529 | printk("/%d", class->subclass); | 515 | printk("/%d", class->subclass); |
530 | } | 516 | } |
517 | } | ||
518 | |||
519 | static void print_lock_name(struct lock_class *class) | ||
520 | { | ||
521 | char usage[LOCK_USAGE_CHARS]; | ||
522 | |||
523 | get_usage_chars(class, usage); | ||
524 | |||
525 | printk(" ("); | ||
526 | __print_lock_name(class); | ||
531 | printk("){%s}", usage); | 527 | printk("){%s}", usage); |
532 | } | 528 | } |
533 | 529 | ||
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 900b409543db..b1e8943fed1d 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -152,7 +152,6 @@ void clear_ftrace_function(void) | |||
152 | ftrace_pid_function = ftrace_stub; | 152 | ftrace_pid_function = ftrace_stub; |
153 | } | 153 | } |
154 | 154 | ||
155 | #undef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST | ||
156 | #ifndef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST | 155 | #ifndef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST |
157 | /* | 156 | /* |
158 | * For those archs that do not test ftrace_trace_stop in their | 157 | * For those archs that do not test ftrace_trace_stop in their |
@@ -1212,7 +1211,9 @@ ftrace_hash_move(struct ftrace_ops *ops, int enable, | |||
1212 | if (!src->count) { | 1211 | if (!src->count) { |
1213 | free_ftrace_hash_rcu(*dst); | 1212 | free_ftrace_hash_rcu(*dst); |
1214 | rcu_assign_pointer(*dst, EMPTY_HASH); | 1213 | rcu_assign_pointer(*dst, EMPTY_HASH); |
1215 | return 0; | 1214 | /* still need to update the function records */ |
1215 | ret = 0; | ||
1216 | goto out; | ||
1216 | } | 1217 | } |
1217 | 1218 | ||
1218 | /* | 1219 | /* |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index f2bd275bb60f..9e158cc84ced 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2140,6 +2140,21 @@ enum print_line_t print_trace_line(struct trace_iterator *iter) | |||
2140 | return print_trace_fmt(iter); | 2140 | return print_trace_fmt(iter); |
2141 | } | 2141 | } |
2142 | 2142 | ||
2143 | void trace_latency_header(struct seq_file *m) | ||
2144 | { | ||
2145 | struct trace_iterator *iter = m->private; | ||
2146 | |||
2147 | /* print nothing if the buffers are empty */ | ||
2148 | if (trace_empty(iter)) | ||
2149 | return; | ||
2150 | |||
2151 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) | ||
2152 | print_trace_header(m, iter); | ||
2153 | |||
2154 | if (!(trace_flags & TRACE_ITER_VERBOSE)) | ||
2155 | print_lat_help_header(m); | ||
2156 | } | ||
2157 | |||
2143 | void trace_default_header(struct seq_file *m) | 2158 | void trace_default_header(struct seq_file *m) |
2144 | { | 2159 | { |
2145 | struct trace_iterator *iter = m->private; | 2160 | struct trace_iterator *iter = m->private; |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 092e1f8d18dc..f8ec2291b522 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -370,6 +370,7 @@ void trace_graph_function(struct trace_array *tr, | |||
370 | unsigned long ip, | 370 | unsigned long ip, |
371 | unsigned long parent_ip, | 371 | unsigned long parent_ip, |
372 | unsigned long flags, int pc); | 372 | unsigned long flags, int pc); |
373 | void trace_latency_header(struct seq_file *m); | ||
373 | void trace_default_header(struct seq_file *m); | 374 | void trace_default_header(struct seq_file *m); |
374 | void print_trace_header(struct seq_file *m, struct trace_iterator *iter); | 375 | void print_trace_header(struct seq_file *m, struct trace_iterator *iter); |
375 | int trace_empty(struct trace_iterator *iter); | 376 | int trace_empty(struct trace_iterator *iter); |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 581876f9f387..c212a7f934ec 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -1078,7 +1078,6 @@ event_subsystem_dir(const char *name, struct dentry *d_events) | |||
1078 | /* First see if we did not already create this dir */ | 1078 | /* First see if we did not already create this dir */ |
1079 | list_for_each_entry(system, &event_subsystems, list) { | 1079 | list_for_each_entry(system, &event_subsystems, list) { |
1080 | if (strcmp(system->name, name) == 0) { | 1080 | if (strcmp(system->name, name) == 0) { |
1081 | __get_system(system); | ||
1082 | system->nr_events++; | 1081 | system->nr_events++; |
1083 | return system->entry; | 1082 | return system->entry; |
1084 | } | 1083 | } |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 816d3d074979..fdc6d22d406b 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -27,6 +27,12 @@ | |||
27 | #include "trace.h" | 27 | #include "trace.h" |
28 | #include "trace_output.h" | 28 | #include "trace_output.h" |
29 | 29 | ||
30 | #define DEFAULT_SYS_FILTER_MESSAGE \ | ||
31 | "### global filter ###\n" \ | ||
32 | "# Use this to set filters for multiple events.\n" \ | ||
33 | "# Only events with the given fields will be affected.\n" \ | ||
34 | "# If no events are modified, an error message will be displayed here" | ||
35 | |||
30 | enum filter_op_ids | 36 | enum filter_op_ids |
31 | { | 37 | { |
32 | OP_OR, | 38 | OP_OR, |
@@ -646,7 +652,7 @@ void print_subsystem_event_filter(struct event_subsystem *system, | |||
646 | if (filter && filter->filter_string) | 652 | if (filter && filter->filter_string) |
647 | trace_seq_printf(s, "%s\n", filter->filter_string); | 653 | trace_seq_printf(s, "%s\n", filter->filter_string); |
648 | else | 654 | else |
649 | trace_seq_printf(s, "none\n"); | 655 | trace_seq_printf(s, DEFAULT_SYS_FILTER_MESSAGE "\n"); |
650 | mutex_unlock(&event_mutex); | 656 | mutex_unlock(&event_mutex); |
651 | } | 657 | } |
652 | 658 | ||
@@ -1649,7 +1655,9 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1649 | */ | 1655 | */ |
1650 | err = replace_preds(call, NULL, ps, filter_string, true); | 1656 | err = replace_preds(call, NULL, ps, filter_string, true); |
1651 | if (err) | 1657 | if (err) |
1652 | goto fail; | 1658 | call->flags |= TRACE_EVENT_FL_NO_SET_FILTER; |
1659 | else | ||
1660 | call->flags &= ~TRACE_EVENT_FL_NO_SET_FILTER; | ||
1653 | } | 1661 | } |
1654 | 1662 | ||
1655 | list_for_each_entry(call, &ftrace_events, list) { | 1663 | list_for_each_entry(call, &ftrace_events, list) { |
@@ -1658,6 +1666,9 @@ static int replace_system_preds(struct event_subsystem *system, | |||
1658 | if (strcmp(call->class->system, system->name) != 0) | 1666 | if (strcmp(call->class->system, system->name) != 0) |
1659 | continue; | 1667 | continue; |
1660 | 1668 | ||
1669 | if (call->flags & TRACE_EVENT_FL_NO_SET_FILTER) | ||
1670 | continue; | ||
1671 | |||
1661 | filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); | 1672 | filter_item = kzalloc(sizeof(*filter_item), GFP_KERNEL); |
1662 | if (!filter_item) | 1673 | if (!filter_item) |
1663 | goto fail_mem; | 1674 | goto fail_mem; |
@@ -1833,7 +1844,10 @@ int apply_subsystem_event_filter(struct event_subsystem *system, | |||
1833 | if (!filter) | 1844 | if (!filter) |
1834 | goto out; | 1845 | goto out; |
1835 | 1846 | ||
1836 | replace_filter_string(filter, filter_string); | 1847 | /* System filters just show a default message */ |
1848 | kfree(filter->filter_string); | ||
1849 | filter->filter_string = NULL; | ||
1850 | |||
1837 | /* | 1851 | /* |
1838 | * No event actually uses the system filter | 1852 | * No event actually uses the system filter |
1839 | * we can free it without synchronize_sched(). | 1853 | * we can free it without synchronize_sched(). |
@@ -1843,14 +1857,12 @@ int apply_subsystem_event_filter(struct event_subsystem *system, | |||
1843 | 1857 | ||
1844 | parse_init(ps, filter_ops, filter_string); | 1858 | parse_init(ps, filter_ops, filter_string); |
1845 | err = filter_parse(ps); | 1859 | err = filter_parse(ps); |
1846 | if (err) { | 1860 | if (err) |
1847 | append_filter_err(ps, system->filter); | 1861 | goto err_filter; |
1848 | goto out; | ||
1849 | } | ||
1850 | 1862 | ||
1851 | err = replace_system_preds(system, ps, filter_string); | 1863 | err = replace_system_preds(system, ps, filter_string); |
1852 | if (err) | 1864 | if (err) |
1853 | append_filter_err(ps, system->filter); | 1865 | goto err_filter; |
1854 | 1866 | ||
1855 | out: | 1867 | out: |
1856 | filter_opstack_clear(ps); | 1868 | filter_opstack_clear(ps); |
@@ -1860,6 +1872,11 @@ out_unlock: | |||
1860 | mutex_unlock(&event_mutex); | 1872 | mutex_unlock(&event_mutex); |
1861 | 1873 | ||
1862 | return err; | 1874 | return err; |
1875 | |||
1876 | err_filter: | ||
1877 | replace_filter_string(filter, filter_string); | ||
1878 | append_filter_err(ps, system->filter); | ||
1879 | goto out; | ||
1863 | } | 1880 | } |
1864 | 1881 | ||
1865 | #ifdef CONFIG_PERF_EVENTS | 1882 | #ifdef CONFIG_PERF_EVENTS |
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c index 20dad0d7a163..99d20e920368 100644 --- a/kernel/trace/trace_irqsoff.c +++ b/kernel/trace/trace_irqsoff.c | |||
@@ -280,9 +280,20 @@ static enum print_line_t irqsoff_print_line(struct trace_iterator *iter) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | static void irqsoff_graph_return(struct ftrace_graph_ret *trace) { } | 282 | static void irqsoff_graph_return(struct ftrace_graph_ret *trace) { } |
283 | static void irqsoff_print_header(struct seq_file *s) { } | ||
284 | static void irqsoff_trace_open(struct trace_iterator *iter) { } | 283 | static void irqsoff_trace_open(struct trace_iterator *iter) { } |
285 | static void irqsoff_trace_close(struct trace_iterator *iter) { } | 284 | static void irqsoff_trace_close(struct trace_iterator *iter) { } |
285 | |||
286 | #ifdef CONFIG_FUNCTION_TRACER | ||
287 | static void irqsoff_print_header(struct seq_file *s) | ||
288 | { | ||
289 | trace_default_header(s); | ||
290 | } | ||
291 | #else | ||
292 | static void irqsoff_print_header(struct seq_file *s) | ||
293 | { | ||
294 | trace_latency_header(s); | ||
295 | } | ||
296 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
286 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 297 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
287 | 298 | ||
288 | /* | 299 | /* |
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index e4a70c0c71b6..ff791ea48b57 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -280,9 +280,20 @@ static enum print_line_t wakeup_print_line(struct trace_iterator *iter) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | static void wakeup_graph_return(struct ftrace_graph_ret *trace) { } | 282 | static void wakeup_graph_return(struct ftrace_graph_ret *trace) { } |
283 | static void wakeup_print_header(struct seq_file *s) { } | ||
284 | static void wakeup_trace_open(struct trace_iterator *iter) { } | 283 | static void wakeup_trace_open(struct trace_iterator *iter) { } |
285 | static void wakeup_trace_close(struct trace_iterator *iter) { } | 284 | static void wakeup_trace_close(struct trace_iterator *iter) { } |
285 | |||
286 | #ifdef CONFIG_FUNCTION_TRACER | ||
287 | static void wakeup_print_header(struct seq_file *s) | ||
288 | { | ||
289 | trace_default_header(s); | ||
290 | } | ||
291 | #else | ||
292 | static void wakeup_print_header(struct seq_file *s) | ||
293 | { | ||
294 | trace_latency_header(s); | ||
295 | } | ||
296 | #endif /* CONFIG_FUNCTION_TRACER */ | ||
286 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 297 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
287 | 298 | ||
288 | /* | 299 | /* |
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 0a7ed5b5e281..6c164dc9ee95 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -1537,6 +1537,8 @@ process_flags(struct event *event, struct print_arg *arg, char **tok) | |||
1537 | field = malloc_or_die(sizeof(*field)); | 1537 | field = malloc_or_die(sizeof(*field)); |
1538 | 1538 | ||
1539 | type = process_arg(event, field, &token); | 1539 | type = process_arg(event, field, &token); |
1540 | while (type == EVENT_OP) | ||
1541 | type = process_op(event, field, &token); | ||
1540 | if (test_type_token(type, token, EVENT_DELIM, ",")) | 1542 | if (test_type_token(type, token, EVENT_DELIM, ",")) |
1541 | goto out_free; | 1543 | goto out_free; |
1542 | 1544 | ||