]> asedeno.scripts.mit.edu Git - linux.git/commit
perf symbols: Add BSS symbols when reading from /proc/kallsyms
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Jun 2018 20:06:57 +0000 (17:06 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 6 Jun 2018 15:52:09 +0000 (12:52 -0300)
commit2be732c02adb15ed7f2196f075fe63ba6991642c
tree3e86f2f64f890016286f7bc6d176c2491969d6e2
parent8d628d26b997e6b2e93bf31cfc09e42cc496922e
perf symbols: Add BSS symbols when reading from /proc/kallsyms

We were not considering 'B' and 'b' (BSS, uninitialized data objects,
that gets set to zero at program start), do it so that we can resolve
more symbols in tools doing resolution of data operands, like 'perf c2c'.

When using vmlinux, i.e. an ELF symbol table, those were already
considered, as the decision was about STT_FUNC or STT_OBJECT, and the
later covers BSS symbols.

  # grep -i ' b ' /proc/kallsyms  | head -20 | tail -5
  ffffffffa789d030 b execute_command
  ffffffffa789d038 b initcall_command_line
  ffffffffa789d040 b static_command_line
  ffffffffa789d048 B ROOT_DEV
  ffffffffa789d050 b once.73786
  #
  # readelf -s /lib/modules/`uname -r`/build/vmlinux | grep ROOT_DEV
  79219: ffffffff8289d048     4 OBJECT  GLOBAL DEFAULT   58 ROOT_DEV
  #

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-z960xobig39ca1pmp5brl2fr@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol.c