提交 76b10655 编写于 作者: A Andi Kleen 提交者: Arnaldo Carvalho de Melo

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: NNamhyung Kim <namhyung@kernel.org>
Signed-off-by: NAndi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20150811133655.GC4524@tassilo.jf.intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 28ebb87c
...@@ -330,6 +330,8 @@ static char *get_srcfile(struct hist_entry *e) ...@@ -330,6 +330,8 @@ static char *get_srcfile(struct hist_entry *e)
sf = get_srcline(map->dso, map__rip_2objdump(map, e->ip), sf = get_srcline(map->dso, map__rip_2objdump(map, e->ip),
e->ms.sym, true); e->ms.sym, true);
if (!strcmp(sf, SRCLINE_UNKNOWN))
return no_srcfile;
p = strchr(sf, ':'); p = strchr(sf, ':');
if (p && *sf) { if (p && *sf) {
*p = 0; *p = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册