path: root/tools/perf/builtin.h
diff options
authorMasami Hiramatsu <>2009-10-08 17:17:38 -0400
committerFrederic Weisbecker <>2009-10-12 23:31:52 +0200
commit4ea42b181434bfc6a0a18d32214130a242d489bf (patch)
tree2c467d795d90440e0293951087c41caca8397584 /tools/perf/builtin.h
parente93f4d8539d5e9dd59f4af9d8ef4e9b62cfa1f81 (diff)
perf: Add perf probe subcommand, a kprobe-event setup helper
Add perf probe subcommand that implements a kprobe-event setup helper to the perf command. This allows user to define kprobe events using C expressions (C line numbers, C function names, and C local variables). Usage ----- perf probe [<options>] -P 'PROBEDEF' [-P 'PROBEDEF' ...] -k, --vmlinux <file> vmlinux/module pathname -P, --probe <p|r:[GRP/]NAME FUNC[+OFFS][@SRC]|@SRC:LINE [ARG ...]> probe point definition, where p: kprobe probe r: kretprobe probe GRP: Group name (optional) NAME: Event name FUNC: Function name OFFS: Offset from function entry (in byte) SRC: Source code path LINE: Line number ARG: Probe argument (local variable name or kprobe-tracer argument format is supported.) Changes in v4: - Add _GNU_SOURCE macro for strndup(). Changes in v3: - Remove -r option because perf always be used for online kernel. - Check malloc/calloc results. Changes in v2: - Check synthesized string length. - Rename perf kprobe to perf probe. - Use spaces for separator and update usage comment. - Check error paths in parse_probepoint(). - Check optimized-out variables. Signed-off-by: Masami Hiramatsu <> Cc: Ingo Molnar <> Cc: Thomas Gleixner <> Cc: Arnaldo Carvalho de Melo <> Cc: Steven Rostedt <> Cc: Mike Galbraith <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Cc: Christoph Hellwig <> Cc: Ananth N Mavinakayanahalli <> Cc: Jim Keniston <> Cc: Frank Ch. Eigler <> LKML-Reference: <> Signed-off-by: Frederic Weisbecker <>
Diffstat (limited to 'tools/perf/builtin.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h
index e11d8d231c3b..ad5f0f4c49ee 100644
--- a/tools/perf/builtin.h
+++ b/tools/perf/builtin.h
@@ -25,5 +25,6 @@ extern int cmd_timechart(int argc, const char **argv, const char *prefix);
extern int cmd_top(int argc, const char **argv, const char *prefix);
extern int cmd_trace(int argc, const char **argv, const char *prefix);
extern int cmd_version(int argc, const char **argv, const char *prefix);
+extern int cmd_probe(int argc, const char **argv, const char *prefix);