aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-03-04 08:19:36 -0500
committerIngo Molnar <mingo@elte.hu>2010-03-10 07:23:33 -0500
commit1676b8a077c352085d52578fb4f29350b58b6e74 (patch)
tree95931b2f1c1f50d6459eb3f13e16c9d38a160383 /tools/perf/builtin-top.c
parentef21f683a045a79b6aa86ad81e5fdfc0d5ddd250 (diff)
perf-top: Show the percentage of successfull PEBS-fixups
Use the PERF_RECORD_MISC_EXACT information to measure the success rate of the PEBS fix-up. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@infradead.org> Cc: paulus@samba.org Cc: eranian@google.com Cc: robert.richter@amd.com Cc: fweisbec@gmail.com LKML-Reference: <20100304140100.694233760@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 31f2e597800c..c051833f755c 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -410,6 +410,7 @@ static double sym_weight(const struct sym_entry *sym)
410 410
411static long samples; 411static long samples;
412static long userspace_samples; 412static long userspace_samples;
413static long exact_samples;
413static const char CONSOLE_CLEAR[] = ""; 414static const char CONSOLE_CLEAR[] = "";
414 415
415static void __list_insert_active_sym(struct sym_entry *syme) 416static void __list_insert_active_sym(struct sym_entry *syme)
@@ -450,6 +451,7 @@ static void print_sym_table(void)
450 int counter, snap = !display_weighted ? sym_counter : 0; 451 int counter, snap = !display_weighted ? sym_counter : 0;
451 float samples_per_sec = samples/delay_secs; 452 float samples_per_sec = samples/delay_secs;
452 float ksamples_per_sec = (samples-userspace_samples)/delay_secs; 453 float ksamples_per_sec = (samples-userspace_samples)/delay_secs;
454 float esamples_percent = (100.0*exact_samples)/samples;
453 float sum_ksamples = 0.0; 455 float sum_ksamples = 0.0;
454 struct sym_entry *syme, *n; 456 struct sym_entry *syme, *n;
455 struct rb_root tmp = RB_ROOT; 457 struct rb_root tmp = RB_ROOT;
@@ -457,7 +459,7 @@ static void print_sym_table(void)
457 int sym_width = 0, dso_width = 0, max_dso_width; 459 int sym_width = 0, dso_width = 0, max_dso_width;
458 const int win_width = winsize.ws_col - 1; 460 const int win_width = winsize.ws_col - 1;
459 461
460 samples = userspace_samples = 0; 462 samples = userspace_samples = exact_samples = 0;
461 463
462 /* Sort the active symbols */ 464 /* Sort the active symbols */
463 pthread_mutex_lock(&active_symbols_lock); 465 pthread_mutex_lock(&active_symbols_lock);
@@ -488,9 +490,10 @@ static void print_sym_table(void)
488 puts(CONSOLE_CLEAR); 490 puts(CONSOLE_CLEAR);
489 491
490 printf("%-*.*s\n", win_width, win_width, graph_dotted_line); 492 printf("%-*.*s\n", win_width, win_width, graph_dotted_line);
491 printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [", 493 printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% exact: %4.1f%% [",
492 samples_per_sec, 494 samples_per_sec,
493 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec))); 495 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec)),
496 esamples_percent);
494 497
495 if (nr_counters == 1 || !display_weighted) { 498 if (nr_counters == 1 || !display_weighted) {
496 printf("%Ld", (u64)attrs[0].sample_period); 499 printf("%Ld", (u64)attrs[0].sample_period);
@@ -954,6 +957,9 @@ static void event__process_sample(const event_t *self,
954 return; 957 return;
955 } 958 }
956 959
960 if (self->header.misc & PERF_RECORD_MISC_EXACT)
961 exact_samples++;
962
957 if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 || 963 if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 ||
958 al.filtered) 964 al.filtered)
959 return; 965 return;