提交 1676b8a0 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

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: NPeter 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: NIngo Molnar <mingo@elte.hu>
上级 ef21f683
...@@ -410,6 +410,7 @@ static double sym_weight(const struct sym_entry *sym) ...@@ -410,6 +410,7 @@ static double sym_weight(const struct sym_entry *sym)
static long samples; static long samples;
static long userspace_samples; static long userspace_samples;
static long exact_samples;
static const char CONSOLE_CLEAR[] = ""; static const char CONSOLE_CLEAR[] = "";
static void __list_insert_active_sym(struct sym_entry *syme) static void __list_insert_active_sym(struct sym_entry *syme)
...@@ -450,6 +451,7 @@ static void print_sym_table(void) ...@@ -450,6 +451,7 @@ static void print_sym_table(void)
int counter, snap = !display_weighted ? sym_counter : 0; int counter, snap = !display_weighted ? sym_counter : 0;
float samples_per_sec = samples/delay_secs; float samples_per_sec = samples/delay_secs;
float ksamples_per_sec = (samples-userspace_samples)/delay_secs; float ksamples_per_sec = (samples-userspace_samples)/delay_secs;
float esamples_percent = (100.0*exact_samples)/samples;
float sum_ksamples = 0.0; float sum_ksamples = 0.0;
struct sym_entry *syme, *n; struct sym_entry *syme, *n;
struct rb_root tmp = RB_ROOT; struct rb_root tmp = RB_ROOT;
...@@ -457,7 +459,7 @@ static void print_sym_table(void) ...@@ -457,7 +459,7 @@ static void print_sym_table(void)
int sym_width = 0, dso_width = 0, max_dso_width; int sym_width = 0, dso_width = 0, max_dso_width;
const int win_width = winsize.ws_col - 1; const int win_width = winsize.ws_col - 1;
samples = userspace_samples = 0; samples = userspace_samples = exact_samples = 0;
/* Sort the active symbols */ /* Sort the active symbols */
pthread_mutex_lock(&active_symbols_lock); pthread_mutex_lock(&active_symbols_lock);
...@@ -488,9 +490,10 @@ static void print_sym_table(void) ...@@ -488,9 +490,10 @@ static void print_sym_table(void)
puts(CONSOLE_CLEAR); puts(CONSOLE_CLEAR);
printf("%-*.*s\n", win_width, win_width, graph_dotted_line); printf("%-*.*s\n", win_width, win_width, graph_dotted_line);
printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% [", printf( " PerfTop:%8.0f irqs/sec kernel:%4.1f%% exact: %4.1f%% [",
samples_per_sec, samples_per_sec,
100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec))); 100.0 - (100.0*((samples_per_sec-ksamples_per_sec)/samples_per_sec)),
esamples_percent);
if (nr_counters == 1 || !display_weighted) { if (nr_counters == 1 || !display_weighted) {
printf("%Ld", (u64)attrs[0].sample_period); printf("%Ld", (u64)attrs[0].sample_period);
...@@ -954,6 +957,9 @@ static void event__process_sample(const event_t *self, ...@@ -954,6 +957,9 @@ static void event__process_sample(const event_t *self,
return; return;
} }
if (self->header.misc & PERF_RECORD_MISC_EXACT)
exact_samples++;
if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 || if (event__preprocess_sample(self, session, &al, symbol_filter) < 0 ||
al.filtered) al.filtered)
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册