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 /kernel/trace | |
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
Diffstat (limited to 'kernel/trace')
-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 |
7 files changed, 68 insertions, 13 deletions
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 | /* |