diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-05 07:27:02 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-05 07:39:23 -0400 |
commit | cf1f45744c6fa3501e0a6f0ddc418f0ef27e725b (patch) | |
tree | ca0823475af28c2b0bcbcc699111712d50836115 /Documentation/perf_counter/builtin-top.c | |
parent | f250c030a87273f8838a2302bee7c2b4d03e9151 (diff) |
perf record, top: Implement --freq
Support frequency-based profiling and make it the default.
(Also add a Hz printout in perf top.)
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/perf_counter/builtin-top.c')
-rw-r--r-- | Documentation/perf_counter/builtin-top.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c index 28cbde4b6e83..2fee5951b231 100644 --- a/Documentation/perf_counter/builtin-top.c +++ b/Documentation/perf_counter/builtin-top.c | |||
@@ -74,8 +74,8 @@ static int nr_cpus = 0; | |||
74 | static unsigned int realtime_prio = 0; | 74 | static unsigned int realtime_prio = 0; |
75 | static int group = 0; | 75 | static int group = 0; |
76 | static unsigned int page_size; | 76 | static unsigned int page_size; |
77 | static unsigned int mmap_pages = 16; | 77 | static unsigned int mmap_pages = 16; |
78 | static int freq = 0; | 78 | static int freq = 0; |
79 | 79 | ||
80 | static char *sym_filter; | 80 | static char *sym_filter; |
81 | static unsigned long filter_start; | 81 | static unsigned long filter_start; |
@@ -212,8 +212,13 @@ static void print_sym_table(void) | |||
212 | events_per_sec, | 212 | events_per_sec, |
213 | 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec))); | 213 | 100.0 - (100.0*((events_per_sec-kevents_per_sec)/events_per_sec))); |
214 | 214 | ||
215 | if (nr_counters == 1) | 215 | if (nr_counters == 1) { |
216 | printf("%d ", event_count[0]); | 216 | printf("%d", event_count[0]); |
217 | if (freq) | ||
218 | printf("Hz "); | ||
219 | else | ||
220 | printf(" "); | ||
221 | } | ||
217 | 222 | ||
218 | for (counter = 0; counter < nr_counters; counter++) { | 223 | for (counter = 0; counter < nr_counters; counter++) { |
219 | if (counter) | 224 | if (counter) |