aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-probe.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-11-30 19:20:17 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-01 02:20:02 -0500
commit4de189fe6e5ad8241f6f8709d2e2ba4c3aeae33a (patch)
treeba4d4d6771df1a7d92bd7f8d0c2bce6369e67124 /tools/perf/builtin-probe.c
parente1c01d61a98703fcc80d15b8068ec36d5a215f7e (diff)
perf probe: Add --list option for listing current probe events
Add --list option for listing currently defined probe events in the kernel. This shows events in below format; [group:event] <perf-probe probe-definition> for example: [probe:schedule_0] schedule+30 cpu Note that source file/line information is not supported yet. So even if you added a probe by line, it will be shown in <symbol+offset>. Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Cc: systemtap <systemtap@sources.redhat.com> Cc: DLE <dle-develop@lists.sourceforge.net> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Jim Keniston <jkenisto@us.ibm.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Frank Ch. Eigler <fche@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jason Baron <jbaron@redhat.com> Cc: K.Prasad <prasad@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20091201002017.10235.76575.stgit@harusame> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-probe.c')
-rw-r--r--tools/perf/builtin-probe.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index bf20df2e816d..b5d15cf25471 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -62,6 +62,8 @@ static struct {
62 struct probe_point probes[MAX_PROBES]; 62 struct probe_point probes[MAX_PROBES];
63} session; 63} session;
64 64
65static bool listing;
66
65/* Parse an event definition. Note that any error must die. */ 67/* Parse an event definition. Note that any error must die. */
66static void parse_probe_event(const char *str) 68static void parse_probe_event(const char *str)
67{ 69{
@@ -119,6 +121,7 @@ static int open_default_vmlinux(void)
119static const char * const probe_usage[] = { 121static const char * const probe_usage[] = {
120 "perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]", 122 "perf probe [<options>] 'PROBEDEF' ['PROBEDEF' ...]",
121 "perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]", 123 "perf probe [<options>] --add 'PROBEDEF' [--add 'PROBEDEF' ...]",
124 "perf probe --list",
122 NULL 125 NULL
123}; 126};
124 127
@@ -129,6 +132,7 @@ static const struct option options[] = {
129 OPT_STRING('k', "vmlinux", &session.vmlinux, "file", 132 OPT_STRING('k', "vmlinux", &session.vmlinux, "file",
130 "vmlinux/module pathname"), 133 "vmlinux/module pathname"),
131#endif 134#endif
135 OPT_BOOLEAN('l', "list", &listing, "list up current probes"),
132 OPT_CALLBACK('a', "add", NULL, 136 OPT_CALLBACK('a', "add", NULL,
133#ifdef NO_LIBDWARF 137#ifdef NO_LIBDWARF
134 "FUNC[+OFFS|%return] [ARG ...]", 138 "FUNC[+OFFS|%return] [ARG ...]",
@@ -164,9 +168,15 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
164 for (i = 0; i < argc; i++) 168 for (i = 0; i < argc; i++)
165 parse_probe_event(argv[i]); 169 parse_probe_event(argv[i]);
166 170
167 if (session.nr_probe == 0) 171 if ((session.nr_probe == 0 && !listing) ||
172 (session.nr_probe != 0 && listing))
168 usage_with_options(probe_usage, options); 173 usage_with_options(probe_usage, options);
169 174
175 if (listing) {
176 show_perf_probe_events();
177 return 0;
178 }
179
170 if (session.need_dwarf) 180 if (session.need_dwarf)
171#ifdef NO_LIBDWARF 181#ifdef NO_LIBDWARF
172 die("Debuginfo-analysis is not supported"); 182 die("Debuginfo-analysis is not supported");