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

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: NPeter 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: NIngo Molnar <mingo@elte.hu>
上级 60db5e09
...@@ -98,6 +98,7 @@ static unsigned int page_size; ...@@ -98,6 +98,7 @@ static unsigned int page_size;
static unsigned int mmap_pages = 16; static unsigned int mmap_pages = 16;
static int use_mmap = 0; static int use_mmap = 0;
static int use_munmap = 0; static int use_munmap = 0;
static int freq = 0;
static char *vmlinux; static char *vmlinux;
...@@ -846,9 +847,10 @@ static void process_options(int argc, char **argv) ...@@ -846,9 +847,10 @@ static void process_options(int argc, char **argv)
{"stat", no_argument, NULL, 'S'}, {"stat", no_argument, NULL, 'S'},
{"vmlinux", required_argument, NULL, 'x'}, {"vmlinux", required_argument, NULL, 'x'},
{"zero", no_argument, NULL, 'z'}, {"zero", no_argument, NULL, 'z'},
{"freq", required_argument, NULL, 'F'},
{NULL, 0, NULL, 0 } {NULL, 0, NULL, 0 }
}; };
int c = getopt_long(argc, argv, "+:ac:C:d:De:f:g:hln:m:p:r:s:Sx:zMU", int c = getopt_long(argc, argv, "+:ac:C:d:De:f:g:hln:m:p:r:s:Sx:zMUF:",
long_options, &option_index); long_options, &option_index);
if (c == -1) if (c == -1)
break; break;
...@@ -889,6 +891,7 @@ static void process_options(int argc, char **argv) ...@@ -889,6 +891,7 @@ static void process_options(int argc, char **argv)
case 'm': mmap_pages = atoi(optarg); break; case 'm': mmap_pages = atoi(optarg); break;
case 'M': use_mmap = 1; break; case 'M': use_mmap = 1; break;
case 'U': use_munmap = 1; break; case 'U': use_munmap = 1; break;
case 'F': freq = 1; default_interval = atoi(optarg); break;
default: error = 1; break; default: error = 1; break;
} }
} }
...@@ -1075,6 +1078,7 @@ int cmd_top(int argc, char **argv, const char *prefix) ...@@ -1075,6 +1078,7 @@ int cmd_top(int argc, char **argv, const char *prefix)
hw_event.nmi = nmi; hw_event.nmi = nmi;
hw_event.mmap = use_mmap; hw_event.mmap = use_mmap;
hw_event.munmap = use_munmap; hw_event.munmap = use_munmap;
hw_event.freq = freq;
fd[i][counter] = sys_perf_counter_open(&hw_event, tid, cpu, group_fd, 0); fd[i][counter] = sys_perf_counter_open(&hw_event, tid, cpu, group_fd, 0);
if (fd[i][counter] < 0) { if (fd[i][counter] < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册