aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/probe-event.c
diff options
context:
space:
mode:
authorGravatar Ingo Molnar <mingo@elte.hu> 2011-02-17 14:46:35 +0100
committerGravatar Ingo Molnar <mingo@elte.hu> 2011-02-17 14:46:35 +0100
commitbee96907383e71d3996ba2bd0682fefaa492d942 (patch)
tree3233fb93a559eabd05581373ce41d342e956d79e /tools/perf/util/probe-event.c
parentMerge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
parentperf probe: Show filename which contains target function (diff)
downloadlinux-bee96907383e71d3996ba2bd0682fefaa492d942.tar.gz
linux-bee96907383e71d3996ba2bd0682fefaa492d942.tar.bz2
linux-bee96907383e71d3996ba2bd0682fefaa492d942.zip
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r--tools/perf/util/probe-event.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 9d237e3cff5d..0e3ea1321103 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -409,7 +409,7 @@ int show_line_range(struct line_range *lr, const char *module)
setup_pager();
if (lr->function)
- fprintf(stdout, "<%s:%d>\n", lr->function,
+ fprintf(stdout, "<%s@%s:%d>\n", lr->function, lr->path,
lr->start - lr->offset);
else
fprintf(stdout, "<%s:%d>\n", lr->path, lr->start);
@@ -595,11 +595,11 @@ static int parse_line_num(char **ptr, int *val, const char *what)
* The line range syntax is described by:
*
* SRC[:SLN[+NUM|-ELN]]
- * FNC[:SLN[+NUM|-ELN]]
+ * FNC[@SRC][:SLN[+NUM|-ELN]]
*/
int parse_line_range_desc(const char *arg, struct line_range *lr)
{
- char *range, *name = strdup(arg);
+ char *range, *file, *name = strdup(arg);
int err;
if (!name)
@@ -649,7 +649,16 @@ int parse_line_range_desc(const char *arg, struct line_range *lr)
}
}
- if (strchr(name, '.'))
+ file = strchr(name, '@');
+ if (file) {
+ *file = '\0';
+ lr->file = strdup(++file);
+ if (lr->file == NULL) {
+ err = -ENOMEM;
+ goto err;
+ }
+ lr->function = name;
+ } else if (strchr(name, '.'))
lr->file = name;
else
lr->function = name;