From: Andi Kleen Date: Tue, 11 Aug 2015 13:36:55 +0000 (-0700) Subject: perf sort: Check for SRCLINE_UNKNOWN case in "srcfile" processing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76b10655818c939e257377f83992975a5f55ffb3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Andi Kleen Cc: Jiri Olsa Link: http://lkml.kernel.org/r/20150811133655.GC4524@tassilo.jf.intel.com Signed-off-by: Arnaldo Carvalho de Melo --- 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;