aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-24 16:46:04 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-25 15:39:09 -0400
commite9ea2fde7a07ae60a119171a2946ed2ae778271e (patch)
treecf074dccee95883af56c5abca0555833b4c14c71 /tools/perf/builtin-report.c
parent649c48a9e7fafcc72bfcc99471d9dea98d789d59 (diff)
perf-report: Add bare minimum PERF_EVENT_READ parsing
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>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ec5361c67bf5..681c2233f882 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -100,6 +100,13 @@ struct lost_event {
100 u64 lost; 100 u64 lost;
101}; 101};
102 102
103struct read_event {
104 struct perf_event_header header;
105 u32 pid,tid;
106 u64 value;
107 u64 format[3];
108};
109
103typedef union event_union { 110typedef union event_union {
104 struct perf_event_header header; 111 struct perf_event_header header;
105 struct ip_event ip; 112 struct ip_event ip;
@@ -108,6 +115,7 @@ typedef union event_union {
108 struct fork_event fork; 115 struct fork_event fork;
109 struct period_event period; 116 struct period_event period;
110 struct lost_event lost; 117 struct lost_event lost;
118 struct read_event read;
111} event_t; 119} event_t;
112 120
113static LIST_HEAD(dsos); 121static LIST_HEAD(dsos);
@@ -1350,6 +1358,19 @@ static void trace_event(event_t *event)
1350} 1358}
1351 1359
1352static int 1360static int
1361process_read_event(event_t *event, unsigned long offset, unsigned long head)
1362{
1363 dprintf("%p [%p]: PERF_EVENT_READ: %d %d %Lu\n",
1364 (void *)(offset + head),
1365 (void *)(long)(event->header.size),
1366 event->read.pid,
1367 event->read.tid,
1368 event->read.value);
1369
1370 return 0;
1371}
1372
1373static int
1353process_event(event_t *event, unsigned long offset, unsigned long head) 1374process_event(event_t *event, unsigned long offset, unsigned long head)
1354{ 1375{
1355 trace_event(event); 1376 trace_event(event);
@@ -1373,6 +1394,9 @@ process_event(event_t *event, unsigned long offset, unsigned long head)
1373 case PERF_EVENT_LOST: 1394 case PERF_EVENT_LOST:
1374 return process_lost_event(event, offset, head); 1395 return process_lost_event(event, offset, head);
1375 1396
1397 case PERF_EVENT_READ:
1398 return process_read_event(event, offset, head);
1399
1376 /* 1400 /*
1377 * We dont process them right now but they are fine: 1401 * We dont process them right now but they are fine:
1378 */ 1402 */