aboutsummaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorGravatar Jiri Olsa <jolsa@kernel.org> 2020-08-12 14:31:02 +0200
committerGravatar Alexei Starovoitov <ast@kernel.org> 2020-08-12 18:14:49 -0700
commitb33164f2bd1cedb094c32cb466287116164457ae (patch)
tree0670a45b2d713a2d930155d76e05eaa4a39136b1 /tools/lib
parentlibbpf: Handle GCC built-in types for Arm NEON (diff)
downloadlinux-b33164f2bd1cedb094c32cb466287116164457ae.tar.gz
linux-b33164f2bd1cedb094c32cb466287116164457ae.tar.bz2
linux-b33164f2bd1cedb094c32cb466287116164457ae.zip
bpf: Iterate through all PT_NOTE sections when looking for build id
Currently when we look for build id within bpf_get_stackid helper call, we check the first NOTE section and we fail if build id is not there. However on some system (Fedora) there can be multiple NOTE sections in binaries and build id data is not always the first one, like: $ readelf -a /usr/bin/ls ... [ 2] .note.gnu.propert NOTE 0000000000000338 00000338 0000000000000020 0000000000000000 A 0 0 8358 [ 3] .note.gnu.build-i NOTE 0000000000000358 00000358 0000000000000024 0000000000000000 A 0 0 437c [ 4] .note.ABI-tag NOTE 000000000000037c 0000037c ... So the stack_map_get_build_id function will fail on build id retrieval and fallback to BPF_STACK_BUILD_ID_IP. This patch is changing the stack_map_get_build_id code to iterate through all the NOTE sections and try to get build id data from each of them. When tracing on sched_switch tracepoint that does bpf_get_stackid helper call kernel build, I can see about 60% increase of successful build id retrieval. The rest seems fails on -EFAULT. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20200812123102.20032-1-jolsa@kernel.org
Diffstat (limited to 'tools/lib')
0 files changed, 0 insertions, 0 deletions