aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 72a7f6ae0293..7231f6b19fb4 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -94,7 +94,6 @@ struct perf_session *perf_session__new(const char *filename, int mode, bool forc
94 self->mmap_window = 32; 94 self->mmap_window = 32;
95 self->cwd = NULL; 95 self->cwd = NULL;
96 self->cwdlen = 0; 96 self->cwdlen = 0;
97 self->unknown_events = 0;
98 self->machines = RB_ROOT; 97 self->machines = RB_ROOT;
99 self->repipe = repipe; 98 self->repipe = repipe;
100 INIT_LIST_HEAD(&self->ordered_samples.samples_head); 99 INIT_LIST_HEAD(&self->ordered_samples.samples_head);
@@ -241,36 +240,6 @@ static void perf_event_ops__fill_defaults(struct perf_event_ops *handler)
241 } 240 }
242} 241}
243 242
244static const char *event__name[] = {
245 [0] = "TOTAL",
246 [PERF_RECORD_MMAP] = "MMAP",
247 [PERF_RECORD_LOST] = "LOST",
248 [PERF_RECORD_COMM] = "COMM",
249 [PERF_RECORD_EXIT] = "EXIT",
250 [PERF_RECORD_THROTTLE] = "THROTTLE",
251 [PERF_RECORD_UNTHROTTLE] = "UNTHROTTLE",
252 [PERF_RECORD_FORK] = "FORK",
253 [PERF_RECORD_READ] = "READ",
254 [PERF_RECORD_SAMPLE] = "SAMPLE",
255 [PERF_RECORD_HEADER_ATTR] = "ATTR",
256 [PERF_RECORD_HEADER_EVENT_TYPE] = "EVENT_TYPE",
257 [PERF_RECORD_HEADER_TRACING_DATA] = "TRACING_DATA",
258 [PERF_RECORD_HEADER_BUILD_ID] = "BUILD_ID",
259};
260
261unsigned long event__total[PERF_RECORD_HEADER_MAX];
262
263void event__print_totals(void)
264{
265 int i;
266 for (i = 0; i < PERF_RECORD_HEADER_MAX; ++i) {
267 if (!event__name[i])
268 continue;
269 pr_info("%10s events: %10ld\n",
270 event__name[i], event__total[i]);
271 }
272}
273
274void mem_bswap_64(void *src, int byte_size) 243void mem_bswap_64(void *src, int byte_size)
275{ 244{
276 u64 *m = src; 245 u64 *m = src;
@@ -580,8 +549,7 @@ static int perf_session__process_event(struct perf_session *self,
580 dump_printf("%#Lx [%#x]: PERF_RECORD_%s", 549 dump_printf("%#Lx [%#x]: PERF_RECORD_%s",
581 offset + head, event->header.size, 550 offset + head, event->header.size,
582 event__name[event->header.type]); 551 event__name[event->header.type]);
583 ++event__total[0]; 552 hists__inc_nr_events(self, event->header.type);
584 ++event__total[event->header.type];
585 } 553 }
586 554
587 if (self->header.needs_swap && event__swap_ops[event->header.type]) 555 if (self->header.needs_swap && event__swap_ops[event->header.type])
@@ -619,7 +587,7 @@ static int perf_session__process_event(struct perf_session *self,
619 case PERF_RECORD_FINISHED_ROUND: 587 case PERF_RECORD_FINISHED_ROUND:
620 return ops->finished_round(event, self, ops); 588 return ops->finished_round(event, self, ops);
621 default: 589 default:
622 self->unknown_events++; 590 ++self->hists.stats.nr_unknown_events;
623 return -1; 591 return -1;
624 } 592 }
625} 593}