Skip to content

Commit

Permalink
tools lib traceevent: Allow expressions in __print_symbolic() fields
Browse files Browse the repository at this point in the history
The __print_symbolic() function takes a sequence of key-value pairs for
pretty-printing a constant.  The new kvm:kvm_exit print fmt uses the
expression:

  __print_symbolic(..., { 0x040 + 1, "DB excp" }, ...)

Currently only atoms are supported and this print fmt fails to parse.
This patch adds support for expressions instead of just atoms so that
0x040 + 1 is parsed successfully.

Cc: Avi Kivity <avi@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1337740619-27925-6-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Stefan Hajnoczi authored and Arnaldo Carvalho de Melo committed May 24, 2012
1 parent e76df19 commit 00b9da7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,6 +2124,13 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char **

free_token(token);
type = process_arg(event, arg, &token);

if (type == EVENT_OP)
type = process_op(event, arg, &token);

if (type == EVENT_ERROR)
goto out_free;

if (test_type_token(type, token, EVENT_DELIM, ","))
goto out_free;

Expand Down

0 comments on commit 00b9da7

Please sign in to comment.