diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-05-15 09:19:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-15 09:26:57 -0400 |
commit | f5456a6b056b709282e87a68b4c1b81ac2e866fa (patch) | |
tree | 07637183188a59e31fd4f0769ec0f31e2737a8cf /Documentation/perf_counter/builtin-top.c | |
parent | 60db5e09c13109b13830cc9dcae688003fd39e79 (diff) |
perf top: update to use the new freq interface
Provide perf top -F as alternative to -c.
[ Impact: new 'perf top' feature ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <20090515132018.707922166@chello.nl>
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 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c index b1549dd27720..814b2e4925e3 100644 --- a/Documentation/perf_counter/builtin-top.c +++ b/Documentation/perf_counter/builtin-top.c | |||
@@ -98,6 +98,7 @@ static unsigned int page_size; | |||
98 | static unsigned int mmap_pages = 16; | 98 | static unsigned int mmap_pages = 16; |
99 | static int use_mmap = 0; | 99 | static int use_mmap = 0; |
100 | static int use_munmap = 0; | 100 | static int use_munmap = 0; |
101 | static int freq = 0; | ||
101 | 102 | ||
102 | static char *vmlinux; | 103 | static char *vmlinux; |
103 | 104 | ||
@@ -846,9 +847,10 @@ static void process_options(int argc, char **argv) | |||
846 | {"stat", no_argument, NULL, 'S'}, | 847 | {"stat", no_argument, NULL, 'S'}, |
847 | {"vmlinux", required_argument, NULL, 'x'}, | 848 | {"vmlinux", required_argument, NULL, 'x'}, |
848 | {"zero", no_argument, NULL, 'z'}, | 849 | {"zero", no_argument, NULL, 'z'}, |
850 | {"freq", required_argument, NULL, 'F'}, | ||
849 | {NULL, 0, NULL, 0 } | 851 | {NULL, 0, NULL, 0 } |
850 | }; | 852 | }; |
851 | int c = getopt_long(argc, argv, "+:ac:C:d:De:f:g:hln:m:p:r:s:Sx:zMU", | 853 | int c = getopt_long(argc, argv, "+:ac:C:d:De:f:g:hln:m:p:r:s:Sx:zMUF:", |
852 | long_options, &option_index); | 854 | long_options, &option_index); |
853 | if (c == -1) | 855 | if (c == -1) |
854 | break; | 856 | break; |
@@ -889,6 +891,7 @@ static void process_options(int argc, char **argv) | |||
889 | case 'm': mmap_pages = atoi(optarg); break; | 891 | case 'm': mmap_pages = atoi(optarg); break; |
890 | case 'M': use_mmap = 1; break; | 892 | case 'M': use_mmap = 1; break; |
891 | case 'U': use_munmap = 1; break; | 893 | case 'U': use_munmap = 1; break; |
894 | case 'F': freq = 1; default_interval = atoi(optarg); break; | ||
892 | default: error = 1; break; | 895 | default: error = 1; break; |
893 | } | 896 | } |
894 | } | 897 | } |
@@ -1075,6 +1078,7 @@ int cmd_top(int argc, char **argv, const char *prefix) | |||
1075 | hw_event.nmi = nmi; | 1078 | hw_event.nmi = nmi; |
1076 | hw_event.mmap = use_mmap; | 1079 | hw_event.mmap = use_mmap; |
1077 | hw_event.munmap = use_munmap; | 1080 | hw_event.munmap = use_munmap; |
1081 | hw_event.freq = freq; | ||
1078 | 1082 | ||
1079 | fd[i][counter] = sys_perf_counter_open(&hw_event, tid, cpu, group_fd, 0); | 1083 | fd[i][counter] = sys_perf_counter_open(&hw_event, tid, cpu, group_fd, 0); |
1080 | if (fd[i][counter] < 0) { | 1084 | if (fd[i][counter] < 0) { |