perf srcline: Do not consider empty files as valid srclines
authorMilian Wolff <milian.wolff@kdab.com>
Sun, 6 Aug 2017 21:24:45 +0000 (23:24 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 11 Aug 2017 19:06:31 +0000 (16:06 -0300)
commitd964b1cdbd94f359f1f65f81440be84ceb45978e
tree350064574063c40a8d9f8a3ac2b4145a3af0daa0
parent80c345b255cbb4e9dfb193bf0bf5536217237f6a
perf srcline: Do not consider empty files as valid srclines

Sometimes we get a non-null, but empty, string for the filename from
bfd. This then results in srclines of the form ":0", which is different
from the canonical SRCLINE_UNKNOWN in the form "??:0".  Set the file to
NULL if it is empty to fix this.

Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Yao Jin <yao.jin@linux.intel.com>
Link: http://lkml.kernel.org/r/20170806212446.24925-14-milian.wolff@kdab.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/srcline.c