summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-probe.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2009-10-27 16:43:19 -0400
committerIngo Molnar <mingo@elte.hu>2009-10-29 08:47:49 +0100
commitb0ef07324310d66f660a311d4a8d669eda74f801 (patch)
tree76ca8d6947e9238254fe8b5b7264ba51bd24d618 /tools/perf/builtin-probe.c
parent253977b0d87fbb793f12b1661a763ae264028ccf (diff)
downloadblackbird-op-linux-b0ef07324310d66f660a311d4a8d669eda74f801.tar.gz
blackbird-op-linux-b0ef07324310d66f660a311d4a8d669eda74f801.zip
perf/probes: Support function entry relative line number
Add function-entry relative line number specifying support to perf-probe. This allows users to define probes by line number from entry of the function. e.g. perf probe schedule:16 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: <20091027204319.30545.30678.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.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 92b4c491f23d..a99a366230ab 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -133,17 +133,16 @@ static void parse_probe_point(char *arg, struct probe_point *pp)
}
/* Exclusion check */
- if (pp->line && pp->function)
- semantic_error("Function-relative line number is not"
- " supported yet.");
+ if (pp->line && pp->offset)
+ semantic_error("Offset can't be used with line number.");
if (!pp->line && pp->file && !pp->function)
semantic_error("File always requires line number.");
if (pp->offset && !pp->function)
semantic_error("Offset requires an entry function.");
if (pp->retprobe && !pp->function)
semantic_error("Return probe requires an entry function.");
- if (pp->offset && pp->retprobe)
- semantic_error("Offset can't be used with return probe.");
+ if ((pp->offset || pp->line) && pp->retprobe)
+ semantic_error("Offset/Line can't be used with return probe.");
pr_debug("symbol:%s file:%s line:%d offset:%d, return:%d\n",
pp->function, pp->file, pp->line, pp->offset, pp->retprobe);
@@ -270,7 +269,7 @@ static const struct option options[] = {
#ifdef NO_LIBDWARF
"FUNC[+OFFS|%return] [ARG ...]",
#else
- "FUNC[+OFFS|%return][@SRC]|SRC:LINE [ARG ...]",
+ "FUNC[+OFFS|%return|:RLN][@SRC]|SRC:ALN [ARG ...]",
#endif
"probe point definition, where\n"
"\t\tGRP:\tGroup name (optional)\n"
@@ -282,7 +281,8 @@ static const struct option options[] = {
"\t\tARG:\tProbe argument (only \n"
#else
"\t\tSRC:\tSource code path\n"
- "\t\tLINE:\tLine number\n"
+ "\t\tRLN:\tRelative line number from function entry.\n"
+ "\t\tALN:\tAbsolute line number in file.\n"
"\t\tARG:\tProbe argument (local variable name or\n"
#endif
"\t\t\tkprobe-tracer argument format is supported.)\n",
OpenPOWER on IntegriCloud