Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158294
b: refs/heads/master
c: 561f732
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Aug 31, 2009
1 parent dad17e1 commit c49e90d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b8055a52c8986167e0a7357460d528a00db67e6
refs/heads/master: 561f732c1233f6bf7c3c5c5fb9b4d90bb6c107aa
16 changes: 14 additions & 2 deletions trunk/tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,6 +1548,7 @@ process_str(struct event *event __unused, struct print_arg *arg, char **tok)

arg->type = PRINT_STRING;
arg->string.string = token;
arg->string.offset = -1;

if (read_expected(EVENT_DELIM, (char *)")") < 0)
return EVENT_ERROR;
Expand Down Expand Up @@ -2031,9 +2032,20 @@ static void print_str_arg(void *data, int size,

case PRINT_TYPE:
break;
case PRINT_STRING:
printf("%s", arg->string.string);
case PRINT_STRING: {
int str_offset;

if (arg->string.offset == -1) {
struct format_field *f;

f = find_any_field(event, arg->string.string);
arg->string.offset = f->offset;
}
str_offset = *(int *)(data + arg->string.offset);
str_offset &= 0xffff;
printf("%s", ((char *)data) + str_offset);
break;
}
case PRINT_OP:
/*
* The only op for string should be ? :
Expand Down
1 change: 1 addition & 0 deletions trunk/tools/perf/util/trace-event.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct print_arg_atom {

struct print_arg_string {
char *string;
int offset;
};

struct print_arg_field {
Expand Down

0 comments on commit c49e90d

Please sign in to comment.