perf symbols: Fixup symbol sizes before picking best ones
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 1 Sep 2016 14:00:23 +0000 (11:00 -0300)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:39 +0000 (11:03 +0100)
commitd636f64a48d5b1fe3d9b41e3b907a95fe7926e03
tree566048c1227a1c25b02609e059c097b524680f67
parent44e3b0c77781b1cf42dc3c9fbdeb753137980ee3
perf symbols: Fixup symbol sizes before picking best ones

commit 432746f8e0b6a82ba832b771afe31abd51af6752 upstream.

When we call symbol__fixup_duplicate() we use algorithms to pick the
"best" symbols for cases where there are various functions/aliases to an
address, and those check zero size symbols, which, before calling
symbol__fixup_end() are _all_ symbols in a just parsed kallsyms file.

So first fixup the end, then fixup the duplicates.

Found while trying to figure out why 'perf test vmlinux' failed, see the
output of 'perf test -v vmlinux' to see cases where the symbols picked
as best for vmlinux don't match the ones picked for kallsyms.

Cc: Anton Blanchard <anton@samba.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 694bf407b061 ("perf symbols: Add some heuristics for choosing the best duplicate symbol")
Link: http://lkml.kernel.org/n/tip-rxqvdgr0mqjdxee0kf8i2ufn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
tools/perf/util/symbol-elf.c
tools/perf/util/symbol.c