tools lib traceevent: Add flags NOHANDLE and PRINTRAW to individual events
authorSteven Rostedt <srostedt@redhat.com>
Fri, 1 Nov 2013 21:53:59 +0000 (17:53 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 4 Nov 2013 17:36:27 +0000 (14:36 -0300)
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>
tools/lib/traceevent/event-parse.c
tools/lib/traceevent/event-parse.h

index 85cbbddb68803a8531314ccef5ed98d7eb7d9f9e..fc6f35f591f688347f72e1d6eeaea163f17089e2 100644 (file)
@@ -4446,11 +4446,11 @@ void pevent_event_info(struct trace_seq *s, struct event_format *event,
 {
        int print_pretty = 1;
 
-       if (event->pevent->print_raw)
+       if (event->pevent->print_raw || (event->flags & EVENT_FL_PRINTRAW))
                print_event_fields(s, record->data, record->size, event);
        else {
 
-               if (event->handler)
+               if (event->handler && !(event->flags & EVENT_FL_NOHANDLE))
                        print_pretty = event->handler(s, record, event,
                                                      event->context);
 
index 9ab6367f2fe92299461555d3f78b87872f8bf894..dc8539ee948504ca6c6f5d13cb19d881544671de 100644 (file)
@@ -308,6 +308,8 @@ enum {
        EVENT_FL_ISBPRINT       = 0x04,
        EVENT_FL_ISFUNCENT      = 0x10,
        EVENT_FL_ISFUNCRET      = 0x20,
+       EVENT_FL_NOHANDLE       = 0x40,
+       EVENT_FL_PRINTRAW       = 0x80,
 
        EVENT_FL_FAILED         = 0x80000000
 };