From b0ef07324310d66f660a311d4a8d669eda74f801 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Tue, 27 Oct 2009 16:43:19 -0400 Subject: 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 Cc: Steven Rostedt Cc: Jim Keniston Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Frederic Weisbecker Cc: Jason Baron Cc: K.Prasad Cc: Peter Zijlstra Cc: Srikar Dronamraju LKML-Reference: <20091027204319.30545.30678.stgit@harusame> Signed-off-by: Ingo Molnar --- tools/perf/builtin-probe.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools/perf/builtin-probe.c') diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 92b4c491f23..a99a366230a 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", -- cgit v1.2.3