diff options
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | 2012-05-22 22:36:42 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-24 10:29:25 -0400 |
commit | 00b9da7219cd027a1c51c3ef576aadbbd9fe38fe (patch) | |
tree | 14a930c7e1f76c085bf9e1f894bfd17e190ba912 /tools | |
parent | e76df19bd986656e3c9f4a62e3dd15e7d69b607a (diff) |
tools lib traceevent: Allow expressions in __print_symbolic() fields
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 998534992197..33450c901e17 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -2124,6 +2124,13 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char ** | |||
2124 | 2124 | ||
2125 | free_token(token); | 2125 | free_token(token); |
2126 | type = process_arg(event, arg, &token); | 2126 | type = process_arg(event, arg, &token); |
2127 | |||
2128 | if (type == EVENT_OP) | ||
2129 | type = process_op(event, arg, &token); | ||
2130 | |||
2131 | if (type == EVENT_ERROR) | ||
2132 | goto out_free; | ||
2133 | |||
2127 | if (test_type_token(type, token, EVENT_DELIM, ",")) | 2134 | if (test_type_token(type, token, EVENT_DELIM, ",")) |
2128 | goto out_free; | 2135 | goto out_free; |
2129 | 2136 | ||