diff options
author | Tom Zanussi <tzanussi@gmail.com> | 2012-04-05 18:47:58 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2012-04-25 07:35:22 -0400 |
commit | 5205aec960514089d12dd8e35f2a82584b8e6172 (patch) | |
tree | a535ea86e5d501d3c07dd8aba68ffff41a00aee6 | |
parent | 4dc1024a7a529626de5a800b10088bcbbc1ae941 (diff) |
perf/events: Add flag/symbol format_flags
This is a port of commit eb9a42caa7a92
perf trace: Add flag/symbolic format_flags
of the old trace-event-parse.c to the new event-parse.c that
was written by Tom Zanussi and forward ported by Steven Rostedt.
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index c799c19f9340..f012395d16fb 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -39,6 +39,9 @@ static const char *input_buf; | |||
39 | static unsigned long long input_buf_ptr; | 39 | static unsigned long long input_buf_ptr; |
40 | static unsigned long long input_buf_siz; | 40 | static unsigned long long input_buf_siz; |
41 | 41 | ||
42 | static int is_flag_field; | ||
43 | static int is_symbolic_field; | ||
44 | |||
42 | static int show_warning = 1; | 45 | static int show_warning = 1; |
43 | 46 | ||
44 | #define do_warning(fmt, ...) \ | 47 | #define do_warning(fmt, ...) \ |
@@ -1789,6 +1792,16 @@ process_entry(struct event_format *event __unused, struct print_arg *arg, | |||
1789 | arg->type = PRINT_FIELD; | 1792 | arg->type = PRINT_FIELD; |
1790 | arg->field.name = field; | 1793 | arg->field.name = field; |
1791 | 1794 | ||
1795 | if (is_flag_field) { | ||
1796 | arg->field.field = pevent_find_any_field(event, arg->field.name); | ||
1797 | arg->field.field->flags |= FIELD_IS_FLAG; | ||
1798 | is_flag_field = 0; | ||
1799 | } else if (is_symbolic_field) { | ||
1800 | arg->field.field = pevent_find_any_field(event, arg->field.name); | ||
1801 | arg->field.field->flags |= FIELD_IS_SYMBOLIC; | ||
1802 | is_symbolic_field = 0; | ||
1803 | } | ||
1804 | |||
1792 | type = read_token(&token); | 1805 | type = read_token(&token); |
1793 | *tok = token; | 1806 | *tok = token; |
1794 | 1807 | ||
@@ -2398,10 +2411,12 @@ process_function(struct event_format *event, struct print_arg *arg, | |||
2398 | 2411 | ||
2399 | if (strcmp(token, "__print_flags") == 0) { | 2412 | if (strcmp(token, "__print_flags") == 0) { |
2400 | free_token(token); | 2413 | free_token(token); |
2414 | is_flag_field = 1; | ||
2401 | return process_flags(event, arg, tok); | 2415 | return process_flags(event, arg, tok); |
2402 | } | 2416 | } |
2403 | if (strcmp(token, "__print_symbolic") == 0) { | 2417 | if (strcmp(token, "__print_symbolic") == 0) { |
2404 | free_token(token); | 2418 | free_token(token); |
2419 | is_symbolic_field = 1; | ||
2405 | return process_symbols(event, arg, tok); | 2420 | return process_symbols(event, arg, tok); |
2406 | } | 2421 | } |
2407 | if (strcmp(token, "__get_str") == 0) { | 2422 | if (strcmp(token, "__get_str") == 0) { |