diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-10-27 21:43:10 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-29 08:47:49 +0100 |
commit | 253977b0d87fbb793f12b1661a763ae264028ccf (patch) | |
tree | 498b07b3eb9726d69d7495a523a1e3c81e74bc97 /tools/perf/util/probe-finder.c | |
parent | perf/probes: Improve command-line option of perf-probe (diff) | |
download | linux-253977b0d87fbb793f12b1661a763ae264028ccf.tar.xz linux-253977b0d87fbb793f12b1661a763ae264028ccf.zip |
perf/probes: Improve probe point syntax of perf-probe
This changes probe point syntax of perf-probe as below
<SRC>[:ABS_LN] [ARGS]
or
<FUNC>[+OFFS|%return][@SRC] [ARGS]
And event name and event group name are automatically
generated based on probe-symbol and offset as below.
perfprobes/SYMBOL_OFFSET[_NUM]
Where SYMBOL is the probing symbol and OFFSET is
the byte offset from the symbol.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
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>
LKML-Reference: <20091027204310.30545.84984.stgit@harusame>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r-- | tools/perf/util/probe-finder.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index b98d35ef7116..6d3bac9f9473 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -483,10 +483,20 @@ static void show_probepoint(Dwarf_Die sp_die, Dwarf_Signed offs, if (ret == DW_DLV_OK) { ret = snprintf(tmp, MAX_PROBE_BUFFER, "%s+%u", name, (unsigned int)offs); + /* Copy the function name if possible */ + if (!pp->function) { + pp->function = strdup(name); + pp->offset = offs; + } dwarf_dealloc(__dw_debug, name, DW_DLA_STRING); } else { /* This function has no name. */ ret = snprintf(tmp, MAX_PROBE_BUFFER, "0x%llx", pf->addr); + if (!pp->function) { + /* TODO: Use _stext */ + pp->function = strdup(""); + pp->offset = (int)pf->addr; + } } DIE_IF(ret < 0); DIE_IF(ret >= MAX_PROBE_BUFFER); |