aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-05 16:07:39 -0400
committerIngo Molnar <mingo@elte.hu>2010-05-11 03:14:24 -0400
commitde068ec048f807d4f62b7dda100c23a1365f086f (patch)
tree9d7d7be670747628e2e5ea93db5418ddeb7d739a /tools/perf
parent722154e4cacf015161efe60009ae9be23d492296 (diff)
perf: Fix static strings treated like dynamic ones
The raw_field_ptr() helper, used to retrieve the address of a field inside a trace event, treats every strings as if they were dynamic ie: having a secondary level of indirection to retrieve their contents. FIELD_IS_STRING doesn't mean FIELD_IS_DYNAMIC, we only need to compute the secondary dereference for the latter case. This fixes perf sched segfaults, bad cmdline report and may be some other bugs. Reported-by: Jason Baron <jbaron@redhat.com> Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Tom Zanussi <tzanussi@gmail.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/trace-event-parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 9b3c20f42f98..613c9cc90570 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1925,7 +1925,7 @@ void *raw_field_ptr(struct event *event, const char *name, void *data)
1925 if (!field) 1925 if (!field)
1926 return NULL; 1926 return NULL;
1927 1927
1928 if (field->flags & FIELD_IS_STRING) { 1928 if (field->flags & FIELD_IS_DYNAMIC) {
1929 int offset; 1929 int offset;
1930 1930
1931 offset = *(int *)(data + field->offset); 1931 offset = *(int *)(data + field->offset);