提交 c53b4bb0 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

tools lib symbol: Skip non-address kallsyms line

Adding check on failed attempt to parse the address and skip the line
parsing early in that case.

The address can be replaced with '(null)' string in case user don't have
enough permissions, like:

  $ cat /proc/kallsyms
      (null) A irq_stack_union
      (null) A __per_cpu_start
      ...
Signed-off-by: NJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180215122635.24029-2-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 f1f8ad52
......@@ -38,6 +38,10 @@ int kallsyms__parse(const char *filename, void *arg,
len = hex2u64(line, &start);
/* Skip the line if we failed to parse the address. */
if (!len)
continue;
len++;
if (len + 2 >= line_len)
continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册