linux/tools/perf
Masami Hiramatsu 2a9c8c3609 perf probe: Add lazy line matching support
Add lazy line matching support for specifying new probes.
This also changes the syntax of perf probe a bit. Now
perf probe accepts one of below probe event definitions.

1) Define event based on function name
 [EVENT=]FUNC[@SRC][:RLN|+OFF|%return|;PTN] [ARG ...]

2) Define event based on source file with line number
 [EVENT=]SRC:ALN [ARG ...]

3) Define event based on source file with lazy pattern
 [EVENT=]SRC;PTN [ARG ...]

- New lazy matching pattern(PTN) follows ';' (semicolon). And it
  must be put the end of the definition.
- So, @SRC is no longer the part which must be put at the end
  of the definition.

Note that ';' (semicolon) can be interpreted as the end of
a command by the shell. This means that you need to quote it.
(anyway you will need to quote the lazy pattern itself too,
because it may contains other sensitive characters, like
'[',']' etc.).

Lazy matching
-------------
The lazy line matching is similar to glob matching except
ignoring spaces in both of pattern and target.

e.g.
'a=*' can matches 'a=b', 'a = b', 'a == b' and so on.

This provides some sort of flexibility and robustness to
probe point definitions against minor code changes.
(for example, actual 10th line of schedule() can be changed
 easily by modifying schedule(), but the same line matching
 'rq=cpu_rq*' may still exist.)

Changes in v3:
 - Cast Dwarf_Addr to uintmax_t for printf-formats.

Changes in v2:
 - Cast Dwarf_Addr to unsigned long long for printf-formats.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: K.Prasad <prasad@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
LKML-Reference: <20100225133611.6725.45078.stgit@localhost6.localdomain6>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-02-25 17:49:30 +01:00
..
Documentation perf probe: Add lazy line matching support 2010-02-25 17:49:30 +01:00
bench perf sched: Fix build failure on sparc 2009-12-14 08:59:12 +01:00
scripts perf/scripts: Add syscall tracing scripts 2010-02-25 04:07:48 +01:00
util perf probe: Add lazy line matching support 2010-02-25 17:49:30 +01:00
.gitignore perf: Ignore perf-archive temp file 2010-01-29 10:37:33 +01:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
Makefile perf probe: Use elfutils-libdw for analyzing debuginfo 2010-02-25 17:49:29 +01:00
builtin-annotate.c perf annotate: Defer allocating sym_priv->hist array 2010-02-25 17:39:14 +01:00
builtin-bench.c perf bench: Add "all" pseudo subsystem and "all" pseudo suite 2009-12-14 08:51:19 +01:00
builtin-buildid-cache.c perf buildid-cache: Add new command to manage build-id cache 2010-01-21 08:31:29 +01:00
builtin-buildid-list.c perf build-id: Move the routine to find DSOs with hits to the lib 2010-02-04 09:33:26 +01:00
builtin-diff.c perf tools: Don't cast RIP to pointers 2010-01-16 10:58:45 +01:00
builtin-help.c perf: Make cmd_to_page() function more compact 2010-01-13 10:53:51 +01:00
builtin-kmem.c perf symbols: Remove perf_session usage in symbols layer 2010-02-04 09:33:24 +01:00
builtin-list.c perf list: Fix large list output by using the pager 2009-08-13 09:05:48 +02:00
builtin-lock.c perf lock: Clean up various details 2010-01-31 09:08:27 +01:00
builtin-probe.c perf probe: Add lazy line matching support 2010-02-25 17:49:30 +01:00
builtin-record.c perf record: Fix existing process callgraph symbol 2010-02-08 16:55:52 +01:00
builtin-report.c Merge branch 'perf/urgent' into perf/core 2010-01-29 10:36:22 +01:00
builtin-sched.c perf tools: Don't cast RIP to pointers 2010-01-16 10:58:45 +01:00
builtin-stat.c perf tools: Fix --pid option for stat 2010-01-13 10:09:08 +01:00
builtin-timechart.c Merge branch 'perf/urgent' into perf/core 2010-01-29 10:36:22 +01:00
builtin-top.c perf top: Use a macro instead of a constant variable 2010-02-25 12:26:16 +01:00
builtin-trace.c perf/scripts: Add Python scripting engine 2010-02-25 04:07:29 +01:00
builtin.h perf lock: Introduce new tool "perf lock", for analyzing lock statistics 2010-01-31 09:08:26 +01:00
command-list.txt perf buildid-cache: Add new command to manage build-id cache 2010-01-21 08:31:29 +01:00
design.txt perf: Fix few typos + cosmetics 2010-01-13 17:39:44 +01:00
perf-archive.sh perf archive: Add helper script to package files needed to do analysis 2010-01-16 10:58:49 +01:00
perf.c perf lock: Introduce new tool "perf lock", for analyzing lock statistics 2010-01-31 09:08:26 +01:00
perf.h perf tools: Allow building for ARM 2009-12-11 13:50:21 +01:00