Skip to content

Commit

Permalink
perf tools: Add __data_loc support
Browse files Browse the repository at this point in the history
This patch is required to test the next patch for perf lock.

At 064739b ,
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>
  • Loading branch information
Hitoshi Mitake authored and Ingo Molnar committed Jan 31, 2010
1 parent a8e6f73 commit 86d8d29
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,15 @@ void *raw_field_ptr(struct event *event, const char *name, void *data)
if (!field)
return NULL;

if (field->flags & FIELD_IS_STRING) {
int offset;

offset = *(int *)(data + field->offset);
offset &= 0xffff;

return data + offset;
}

return data + field->offset;
}

Expand Down

0 comments on commit 86d8d29

Please sign in to comment.