perf-report: Add bare minimum PERF_EVENT_READ parsing
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Wed, 24 Jun 2009 20:46:04 +0000 (22:46 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 25 Jun 2009 19:39:09 +0000 (21:39 +0200)
Provide the basic infrastructure to provide per task stats.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-report.c

index ec5361c67bf5def83ca870be4f346eafd55b10b0..681c2233f8827a2709caf1e578318467247d7c85 100644 (file)
@@ -100,6 +100,13 @@ struct lost_event {
        u64 lost;
 };
 
+struct read_event {
+       struct perf_event_header header;
+       u32 pid,tid;
+       u64 value;
+       u64 format[3];
+};
+
 typedef union event_union {
        struct perf_event_header        header;
        struct ip_event                 ip;
@@ -108,6 +115,7 @@ typedef union event_union {
        struct fork_event               fork;
        struct period_event             period;
        struct lost_event               lost;
+       struct read_event               read;
 } event_t;
 
 static LIST_HEAD(dsos);
@@ -1349,6 +1357,19 @@ static void trace_event(event_t *event)
        dprintf(".\n");
 }
 
+static int
+process_read_event(event_t *event, unsigned long offset, unsigned long head)
+{
+       dprintf("%p [%p]: PERF_EVENT_READ: %d %d %Lu\n",
+                       (void *)(offset + head),
+                       (void *)(long)(event->header.size),
+                       event->read.pid,
+                       event->read.tid,
+                       event->read.value);
+
+       return 0;
+}
+
 static int
 process_event(event_t *event, unsigned long offset, unsigned long head)
 {
@@ -1373,6 +1394,9 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
        case PERF_EVENT_LOST:
                return process_lost_event(event, offset, head);
 
+       case PERF_EVENT_READ:
+               return process_read_event(event, offset, head);
+
        /*
         * We dont process them right now but they are fine:
         */
This page took 0.029569 seconds and 5 git commands to generate.