diff options
| author | Franck Bui-Huu <fbuihuu@gmail.com> | 2010-12-20 09:18:03 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-12-21 13:20:12 -0500 |
| commit | 9d95b580a8d64ef4d1660a21a9de0658fe29f041 (patch) | |
| tree | 07ba488512668856ddea211b3941504947f9bf2b | |
| parent | 44b81e929b0c00e703a31a3d634b668bb27eb1c8 (diff) | |
perf probe: Fix line range description since a single file is allowed
$ perf-probe -L sched.c
is currently allowed but not documented.
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <1292854685-8230-5-git-send-email-fbuihuu@gmail.com>
Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/Documentation/perf-probe.txt | 2 | ||||
| -rw-r--r-- | tools/perf/util/probe-event.c | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt index 4e232327698..86b797a35aa 100644 --- a/tools/perf/Documentation/perf-probe.txt +++ b/tools/perf/Documentation/perf-probe.txt | |||
| @@ -117,7 +117,7 @@ LINE SYNTAX | |||
| 117 | ----------- | 117 | ----------- |
| 118 | Line range is described by following syntax. | 118 | Line range is described by following syntax. |
| 119 | 119 | ||
| 120 | "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]" | 120 | "FUNC[:RLN[+NUM|-RLN2]]|SRC[:ALN[+NUM|-ALN2]]" |
| 121 | 121 | ||
| 122 | FUNC specifies the function name of showing lines. 'RLN' is the start line | 122 | FUNC specifies the function name of showing lines. 'RLN' is the start line |
| 123 | number from function entry line, and 'RLN2' is the end line number. As same as | 123 | number from function entry line, and 'RLN2' is the end line number. As same as |
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index b812f1412c3..3ba9c539377 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
| @@ -515,15 +515,18 @@ int show_available_vars(struct perf_probe_event *pevs __unused, | |||
| 515 | } | 515 | } |
| 516 | #endif | 516 | #endif |
| 517 | 517 | ||
| 518 | /* | ||
| 519 | * Stuff 'lr' according to the line range described by 'arg'. | ||
| 520 | * The line range syntax is described by: | ||
| 521 | * | ||
| 522 | * SRC[:SLN[+NUM|-ELN]] | ||
| 523 | * FNC[:SLN[+NUM|-ELN]] | ||
| 524 | */ | ||
| 518 | int parse_line_range_desc(const char *arg, struct line_range *lr) | 525 | int parse_line_range_desc(const char *arg, struct line_range *lr) |
| 519 | { | 526 | { |
| 520 | const char *ptr; | 527 | const char *ptr; |
| 521 | char *tmp; | 528 | char *tmp; |
| 522 | /* | 529 | |
| 523 | * <Syntax> | ||
| 524 | * SRC:SLN[+NUM|-ELN] | ||
| 525 | * FUNC[:SLN[+NUM|-ELN]] | ||
| 526 | */ | ||
| 527 | ptr = strchr(arg, ':'); | 530 | ptr = strchr(arg, ':'); |
| 528 | if (ptr) { | 531 | if (ptr) { |
| 529 | lr->start = (int)strtoul(ptr + 1, &tmp, 0); | 532 | lr->start = (int)strtoul(ptr + 1, &tmp, 0); |
