diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-18 12:13:33 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-18 12:13:33 -0400 |
commit | 16ee6576e25b83806d26eb771138249fcfb5eddc (patch) | |
tree | 7c717b80f28b5c59ba673dc00f2ca9bd0fc068d4 /kernel/trace | |
parent | 16fa7e8200fb9066b77a3f27cbed8e4a9fc71998 (diff) | |
parent | 9b63776fa3ca96c4ecda76f6fa947b7b0add66ac (diff) |
Merge remote-tracking branch 'tip/perf/urgent' into perf/core
Merge reason: We are going to queue up a dependent patch:
"perf tools: Move parse event automated tests to separated object"
That depends on:
commit e7c72d8
perf tools: Add 'G' and 'H' modifiers to event parsing
Conflicts:
tools/perf/builtin-stat.c
Conflicted with the recent 'perf_target' patches when checking the
result of perf_evsel open routines to see if a retry is needed to cope
with older kernels where the exclude guest/host perf_event_attr bits
were not used.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace.h | 4 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 5 | ||||
-rw-r--r-- | kernel/trace/trace_export.c | 1 | ||||
-rw-r--r-- | kernel/trace/trace_output.c | 5 |
5 files changed, 17 insertions, 6 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 48ef4960ec90..509e8615f504 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4759,7 +4759,8 @@ static ssize_t | |||
4759 | rb_simple_read(struct file *filp, char __user *ubuf, | 4759 | rb_simple_read(struct file *filp, char __user *ubuf, |
4760 | size_t cnt, loff_t *ppos) | 4760 | size_t cnt, loff_t *ppos) |
4761 | { | 4761 | { |
4762 | struct ring_buffer *buffer = filp->private_data; | 4762 | struct trace_array *tr = filp->private_data; |
4763 | struct ring_buffer *buffer = tr->buffer; | ||
4763 | char buf[64]; | 4764 | char buf[64]; |
4764 | int r; | 4765 | int r; |
4765 | 4766 | ||
@@ -4777,7 +4778,8 @@ static ssize_t | |||
4777 | rb_simple_write(struct file *filp, const char __user *ubuf, | 4778 | rb_simple_write(struct file *filp, const char __user *ubuf, |
4778 | size_t cnt, loff_t *ppos) | 4779 | size_t cnt, loff_t *ppos) |
4779 | { | 4780 | { |
4780 | struct ring_buffer *buffer = filp->private_data; | 4781 | struct trace_array *tr = filp->private_data; |
4782 | struct ring_buffer *buffer = tr->buffer; | ||
4781 | unsigned long val; | 4783 | unsigned long val; |
4782 | int ret; | 4784 | int ret; |
4783 | 4785 | ||
@@ -4864,7 +4866,7 @@ static __init int tracer_init_debugfs(void) | |||
4864 | &trace_clock_fops); | 4866 | &trace_clock_fops); |
4865 | 4867 | ||
4866 | trace_create_file("tracing_on", 0644, d_tracer, | 4868 | trace_create_file("tracing_on", 0644, d_tracer, |
4867 | global_trace.buffer, &rb_simple_fops); | 4869 | &global_trace, &rb_simple_fops); |
4868 | 4870 | ||
4869 | #ifdef CONFIG_DYNAMIC_FTRACE | 4871 | #ifdef CONFIG_DYNAMIC_FTRACE |
4870 | trace_create_file("dyn_ftrace_total_info", 0444, d_tracer, | 4872 | trace_create_file("dyn_ftrace_total_info", 0444, d_tracer, |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 1c8b7c6f7b3b..6c6f7933eede 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -838,11 +838,11 @@ void trace_printk_init_buffers(void); | |||
838 | filter) | 838 | filter) |
839 | #include "trace_entries.h" | 839 | #include "trace_entries.h" |
840 | 840 | ||
841 | #ifdef CONFIG_FUNCTION_TRACER | 841 | #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_FUNCTION_TRACER) |
842 | int perf_ftrace_event_register(struct ftrace_event_call *call, | 842 | int perf_ftrace_event_register(struct ftrace_event_call *call, |
843 | enum trace_reg type, void *data); | 843 | enum trace_reg type, void *data); |
844 | #else | 844 | #else |
845 | #define perf_ftrace_event_register NULL | 845 | #define perf_ftrace_event_register NULL |
846 | #endif /* CONFIG_FUNCTION_TRACER */ | 846 | #endif |
847 | 847 | ||
848 | #endif /* _LINUX_KERNEL_TRACE_H */ | 848 | #endif /* _LINUX_KERNEL_TRACE_H */ |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 079a93ae8a9d..29111da1d100 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -294,6 +294,9 @@ static int __ftrace_set_clr_event(const char *match, const char *sub, | |||
294 | if (!call->name || !call->class || !call->class->reg) | 294 | if (!call->name || !call->class || !call->class->reg) |
295 | continue; | 295 | continue; |
296 | 296 | ||
297 | if (call->flags & TRACE_EVENT_FL_IGNORE_ENABLE) | ||
298 | continue; | ||
299 | |||
297 | if (match && | 300 | if (match && |
298 | strcmp(match, call->name) != 0 && | 301 | strcmp(match, call->name) != 0 && |
299 | strcmp(match, call->class->system) != 0) | 302 | strcmp(match, call->class->system) != 0) |
@@ -1164,7 +1167,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
1164 | return -1; | 1167 | return -1; |
1165 | } | 1168 | } |
1166 | 1169 | ||
1167 | if (call->class->reg) | 1170 | if (call->class->reg && !(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE)) |
1168 | trace_create_file("enable", 0644, call->dir, call, | 1171 | trace_create_file("enable", 0644, call->dir, call, |
1169 | enable); | 1172 | enable); |
1170 | 1173 | ||
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 3dd15e8bc856..e039906b037d 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -180,6 +180,7 @@ struct ftrace_event_call __used event_##call = { \ | |||
180 | .event.type = etype, \ | 180 | .event.type = etype, \ |
181 | .class = &event_class_ftrace_##call, \ | 181 | .class = &event_class_ftrace_##call, \ |
182 | .print_fmt = print, \ | 182 | .print_fmt = print, \ |
183 | .flags = TRACE_EVENT_FL_IGNORE_ENABLE, \ | ||
183 | }; \ | 184 | }; \ |
184 | struct ftrace_event_call __used \ | 185 | struct ftrace_event_call __used \ |
185 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; | 186 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 859fae6b1825..df611a0e76c5 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -652,6 +652,8 @@ int trace_print_lat_context(struct trace_iterator *iter) | |||
652 | { | 652 | { |
653 | u64 next_ts; | 653 | u64 next_ts; |
654 | int ret; | 654 | int ret; |
655 | /* trace_find_next_entry will reset ent_size */ | ||
656 | int ent_size = iter->ent_size; | ||
655 | struct trace_seq *s = &iter->seq; | 657 | struct trace_seq *s = &iter->seq; |
656 | struct trace_entry *entry = iter->ent, | 658 | struct trace_entry *entry = iter->ent, |
657 | *next_entry = trace_find_next_entry(iter, NULL, | 659 | *next_entry = trace_find_next_entry(iter, NULL, |
@@ -660,6 +662,9 @@ int trace_print_lat_context(struct trace_iterator *iter) | |||
660 | unsigned long abs_usecs = ns2usecs(iter->ts - iter->tr->time_start); | 662 | unsigned long abs_usecs = ns2usecs(iter->ts - iter->tr->time_start); |
661 | unsigned long rel_usecs; | 663 | unsigned long rel_usecs; |
662 | 664 | ||
665 | /* Restore the original ent_size */ | ||
666 | iter->ent_size = ent_size; | ||
667 | |||
663 | if (!next_entry) | 668 | if (!next_entry) |
664 | next_ts = iter->ts; | 669 | next_ts = iter->ts; |
665 | rel_usecs = ns2usecs(next_ts - iter->ts); | 670 | rel_usecs = ns2usecs(next_ts - iter->ts); |