diff options
author | Steven Rostedt <srostedt@redhat.com> | 2013-11-01 17:53:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-04 12:36:27 -0500 |
commit | c6c2b960b7a4105f096499fba3df65d6c0272a20 (patch) | |
tree | 4279f6e6c15b76347e65ec74f0349cadf0df3121 /tools/lib | |
parent | 5efb9fbd5f1bfe4435bd0a3ea5f0e187875509c2 (diff) |
tools lib traceevent: Add flags NOHANDLE and PRINTRAW to individual events
Add the flags EVENT_FL_NOHANDLE and EVENT_FL_PRINTRAW to the event flags
to have the event either ignore the register handler or to ignore the
handler and also print the raw format respectively.
This allows a tool to force a raw format or non handle for an event.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20131101215501.655258742@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/traceevent/event-parse.c | 4 | ||||
-rw-r--r-- | tools/lib/traceevent/event-parse.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 85cbbddb6880..fc6f35f591f6 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c | |||
@@ -4446,11 +4446,11 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event, | |||
4446 | { | 4446 | { |
4447 | int print_pretty = 1; | 4447 | int print_pretty = 1; |
4448 | 4448 | ||
4449 | if (event->pevent->print_raw) | 4449 | if (event->pevent->print_raw || (event->flags & EVENT_FL_PRINTRAW)) |
4450 | print_event_fields(s, record->data, record->size, event); | 4450 | print_event_fields(s, record->data, record->size, event); |
4451 | else { | 4451 | else { |
4452 | 4452 | ||
4453 | if (event->handler) | 4453 | if (event->handler && !(event->flags & EVENT_FL_NOHANDLE)) |
4454 | print_pretty = event->handler(s, record, event, | 4454 | print_pretty = event->handler(s, record, event, |
4455 | event->context); | 4455 | event->context); |
4456 | 4456 | ||
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 9ab6367f2fe9..dc8539ee9485 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
@@ -308,6 +308,8 @@ enum { | |||
308 | EVENT_FL_ISBPRINT = 0x04, | 308 | EVENT_FL_ISBPRINT = 0x04, |
309 | EVENT_FL_ISFUNCENT = 0x10, | 309 | EVENT_FL_ISFUNCENT = 0x10, |
310 | EVENT_FL_ISFUNCRET = 0x20, | 310 | EVENT_FL_ISFUNCRET = 0x20, |
311 | EVENT_FL_NOHANDLE = 0x40, | ||
312 | EVENT_FL_PRINTRAW = 0x80, | ||
311 | 313 | ||
312 | EVENT_FL_FAILED = 0x80000000 | 314 | EVENT_FL_FAILED = 0x80000000 |
313 | }; | 315 | }; |