[tip:perf/core] perf sort: Check for SRCLINE_UNKNOWN case in " srcfile" processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  76b10655818c939e257377f83992975a5f55ffb3
Gitweb:     http://git.kernel.org/tip/76b10655818c939e257377f83992975a5f55ffb3
Author:     Andi Kleen <ak@xxxxxxxxxxxxxxx>
AuthorDate: Tue, 11 Aug 2015 06:36:55 -0700
Committer:  Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Wed, 12 Aug 2015 10:27:02 -0300

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 <namhyung@xxxxxxxxxx>
Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Link: http://lkml.kernel.org/r/20150811133655.GC4524@xxxxxxxxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
 tools/perf/util/sort.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index c0c32b0..7e38716 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux