diff options
author | Ingo Molnar <mingo@kernel.org> | 2013-11-20 14:29:46 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-11-20 14:29:46 +0100 |
commit | e98a6e59dff885eb387163b1a7abe019a44ba90b (patch) | |
tree | 7b6c80f50a69d962765626ef7e3641081dcf2d02 /tools/lib/traceevent/event-parse.c | |
parent | 0022cedd4a7d8a87841351e2b018bb6794cf2e67 (diff) | |
parent | 6b5fa0ba4f85a8499287aefaf3f1375450c40c6d (diff) |
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
* Tag thread comm as overriden, showing the right comm for threads after forks.
(Frederic Weisbecker)
* Fix memory leak when processing perf.data file header. (Namhyung Kim.)
* Don't try to free string constant used for anonymous event groups. (Namhyung Kim)
* Fix use of multiple options in processing field in libtraceevent. (Steven Rostedt)
* Fix conversion of pointer to integer of different size in libtraceevent.
(Arnaldo Carvalho de Melo)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/lib/traceevent/event-parse.c')
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 0362d575de7..217c82ee366 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -1606,6 +1606,24 @@ process_arg(struct event_format *event, struct print_arg *arg, char **tok) static enum event_type process_op(struct event_format *event, struct print_arg *arg, char **tok); +/* + * For __print_symbolic() and __print_flags, we need to completely + * evaluate the first argument, which defines what to print next. + */ +static enum event_type +process_field_arg(struct event_format *event, struct print_arg *arg, char **tok) +{ + enum event_type type; + + type = process_arg(event, arg, tok); + + while (type == EVENT_OP) { + type = process_op(event, arg, tok); + } + + return type; +} + static enum event_type process_cond(struct event_format *event, struct print_arg *top, char **tok) { @@ -2371,7 +2389,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) goto out_free; } - type = process_arg(event, field, &token); + type = process_field_arg(event, field, &token); /* Handle operations in the first argument */ while (type == EVENT_OP) @@ -2424,7 +2442,8 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) goto out_free; } - type = process_arg(event, field, &token); + type = process_field_arg(event, field, &token); + if (test_type_token(type, token, EVENT_DELIM, ",")) goto out_free_field; @@ -3446,7 +3465,7 @@ eval_num_arg(void *data, int size, struct event_format *event, struct print_arg * is in the bottom half of the 32 bit field. */ offset &= 0xffff; - val = (unsigned long long)(data + offset); + val = (unsigned long long)((unsigned long)data + offset); break; default: /* not sure what to do there */ return 0; |