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>
This commit is contained in:
committed by
Ingo Molnar
parent
253977b0d8
commit
b0ef073243
@@ -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",
|
||||
|
Reference in New Issue
Block a user