diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-10-27 16:43:19 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-29 03:47:49 -0400 |
commit | b0ef07324310d66f660a311d4a8d669eda74f801 (patch) | |
tree | 76ca8d6947e9238254fe8b5b7264ba51bd24d618 /tools/perf/builtin-probe.c | |
parent | 253977b0d87fbb793f12b1661a763ae264028ccf (diff) |
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.c | 14 |
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) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /* Exclusion check */ | 135 | /* Exclusion check */ |
136 | if (pp->line && pp->function) | 136 | if (pp->line && pp->offset) |
137 | semantic_error("Function-relative line number is not" | 137 | semantic_error("Offset can't be used with line number."); |
138 | " supported yet."); | ||
139 | if (!pp->line && pp->file && !pp->function) | 138 | if (!pp->line && pp->file && !pp->function) |
140 | semantic_error("File always requires line number."); | 139 | semantic_error("File always requires line number."); |
141 | if (pp->offset && !pp->function) | 140 | if (pp->offset && !pp->function) |
142 | semantic_error("Offset requires an entry function."); | 141 | semantic_error("Offset requires an entry function."); |
143 | if (pp->retprobe && !pp->function) | 142 | if (pp->retprobe && !pp->function) |
144 | semantic_error("Return probe requires an entry function."); | 143 | semantic_error("Return probe requires an entry function."); |
145 | if (pp->offset && pp->retprobe) | 144 | if ((pp->offset || pp->line) && pp->retprobe) |
146 | semantic_error("Offset can't be used with return probe."); | 145 | semantic_error("Offset/Line can't be used with return probe."); |
147 | 146 | ||
148 | pr_debug("symbol:%s file:%s line:%d offset:%d, return:%d\n", | 147 | pr_debug("symbol:%s file:%s line:%d offset:%d, return:%d\n", |
149 | pp->function, pp->file, pp->line, pp->offset, pp->retprobe); | 148 | pp->function, pp->file, pp->line, pp->offset, pp->retprobe); |
@@ -270,7 +269,7 @@ static const struct option options[] = { | |||
270 | #ifdef NO_LIBDWARF | 269 | #ifdef NO_LIBDWARF |
271 | "FUNC[+OFFS|%return] [ARG ...]", | 270 | "FUNC[+OFFS|%return] [ARG ...]", |
272 | #else | 271 | #else |
273 | "FUNC[+OFFS|%return][@SRC]|SRC:LINE [ARG ...]", | 272 | "FUNC[+OFFS|%return|:RLN][@SRC]|SRC:ALN [ARG ...]", |
274 | #endif | 273 | #endif |
275 | "probe point definition, where\n" | 274 | "probe point definition, where\n" |
276 | "\t\tGRP:\tGroup name (optional)\n" | 275 | "\t\tGRP:\tGroup name (optional)\n" |
@@ -282,7 +281,8 @@ static const struct option options[] = { | |||
282 | "\t\tARG:\tProbe argument (only \n" | 281 | "\t\tARG:\tProbe argument (only \n" |
283 | #else | 282 | #else |
284 | "\t\tSRC:\tSource code path\n" | 283 | "\t\tSRC:\tSource code path\n" |
285 | "\t\tLINE:\tLine number\n" | 284 | "\t\tRLN:\tRelative line number from function entry.\n" |
285 | "\t\tALN:\tAbsolute line number in file.\n" | ||
286 | "\t\tARG:\tProbe argument (local variable name or\n" | 286 | "\t\tARG:\tProbe argument (local variable name or\n" |
287 | #endif | 287 | #endif |
288 | "\t\t\tkprobe-tracer argument format is supported.)\n", | 288 | "\t\t\tkprobe-tracer argument format is supported.)\n", |