diff options
author | Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> | 2010-01-30 06:43:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-31 02:27:52 -0500 |
commit | 86d8d29634de4464d568e7c335c0da6cba64e8ab (patch) | |
tree | c4e686f7c0fe18c4b320b083cd54ed8f77ecd4e6 /tools/perf/util | |
parent | a8e6f734ce9a79d44ebb296f2a341f435227b34e (diff) |
perf tools: Add __data_loc support
This patch is required to test the next patch for perf lock.
At 064739bc4b3d7f424b2f25547e6611bcf0132415 ,
support for the modifier "__data_loc" of format is added.
But, when I wanted to parse format of lock_acquired (or some
event else), raw_field_ptr() did not returned correct pointer.
So I modified raw_field_ptr() like this patch. Then
raw_field_ptr() works well.
Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <1264851813-8413-2-git-send-email-mitake@dcl.info.waseda.ac.jp>
[ v3: fixed minor stylistic detail ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index c5c32be040bf..c4b3cb8a02b1 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -1925,6 +1925,15 @@ 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) { | ||
1929 | int offset; | ||
1930 | |||
1931 | offset = *(int *)(data + field->offset); | ||
1932 | offset &= 0xffff; | ||
1933 | |||
1934 | return data + offset; | ||
1935 | } | ||
1936 | |||
1928 | return data + field->offset; | 1937 | return data + field->offset; |
1929 | } | 1938 | } |
1930 | 1939 | ||