linux/tools/perf
Masami Hiramatsu 4ea42b1814 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 <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Frank Ch. Eigler <fche@redhat.com>
LKML-Reference: <20091008211737.29299.14784.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
2009-10-12 23:31:52 +02:00
..
Documentation perf util: Make the timechart SVG width dynamic 2009-09-20 19:37:35 +02:00
util perf: Add perf probe subcommand, a kprobe-event setup helper 2009-10-12 23:31:52 +02:00
.gitignore perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
Makefile perf: Add perf probe subcommand, a kprobe-event setup helper 2009-10-12 23:31:52 +02:00
builtin-annotate.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-help.c perf: Enable more compiler warnings 2009-08-16 10:47:47 +02:00
builtin-list.c perf list: Fix large list output by using the pager 2009-08-13 09:05:48 +02:00
builtin-probe.c perf: Add perf probe subcommand, a kprobe-event setup helper 2009-10-12 23:31:52 +02:00
builtin-record.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-report.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-sched.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-stat.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-timechart.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-top.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin-trace.c perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
builtin.h perf: Add perf probe subcommand, a kprobe-event setup helper 2009-10-12 23:31:52 +02:00
command-list.txt perf: Add timechart help text and add timechart to "perf help" 2009-09-19 18:57:53 +02:00
design.txt perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00
perf.c perf: Add perf probe subcommand, a kprobe-event setup helper 2009-10-12 23:31:52 +02:00
perf.h perf: Do the big rename: Performance Counters -> Performance Events 2009-09-21 14:28:04 +02:00