aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Kleen <[email protected]>2015-08-11 06:36:55 -0700
committerArnaldo Carvalho de Melo <[email protected]>2015-08-12 10:27:02 -0300
commit76b10655818c939e257377f83992975a5f55ffb3 (patch)
tree1c61365ccaa922d4040d5a89c12eed54db8133d2
parent28ebb87c73f9c17266d4f7570d65a1e695df7d9d (diff)
perf sort: Check for SRCLINE_UNKNOWN case in "srcfile" processing
Handle the SRCLINE_UNKNOWN case correctly when processing "srcfile". Commiter note: We can't just free it, as it was't allocated via malloc, its a guard variable. Reported-by: Namhyung Kim <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/sort.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index c0c32b050e45..7e3871606df3 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -330,6 +330,8 @@ static char *get_srcfile(struct hist_entry *e)
sf = get_srcline(map->dso, map__rip_2objdump(map, e->ip),
e->ms.sym, true);
+ if (!strcmp(sf, SRCLINE_UNKNOWN))
+ return no_srcfile;
p = strchr(sf, ':');
if (p && *sf) {
*p = 0;