diff options
author | Daniel Borkmann | 2018-03-15 01:14:01 +0100 |
---|---|---|
committer | Daniel Borkmann | 2018-03-15 01:14:16 +0100 |
commit | 68de5ef4c786f63bf19b146fa009ee9208318d0b (patch) | |
tree | bebe74af6f86ad63719e1d50442482a51a6beedf /mm/process_vm_access.c | |
parent | bpf: comment why dots in filenames under BPF virtual FS are not allowed (diff) | |
parent | bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID (diff) | |
download | kernel-qcow2-linux-68de5ef4c786f63bf19b146fa009ee9208318d0b.tar.gz kernel-qcow2-linux-68de5ef4c786f63bf19b146fa009ee9208318d0b.tar.xz kernel-qcow2-linux-68de5ef4c786f63bf19b146fa009ee9208318d0b.zip |
Merge branch 'bpf-stackmap-build-id'
Song Liu says:
====================
This work follows up discussion at Plumbers'17 on improving addr->sym
resolution of user stack traces. The following links have more information
of the discussion:
http://www.linuxplumbersconf.org/2017/ocw/proposals/4764
https://lwn.net/Articles/734453/ Section "Stack traces and kprobes"
Currently, bpf stackmap store address for each entry in the call trace.
To map these addresses to user space files, it is necessary to maintain
the mapping from these virtual address to symbols in the binary. Usually,
the user space profiler (such as perf) has to scan /proc/pid/maps at the
beginning of profiling, and monitor mmap2() calls afterwards. Given the
cost of maintaining the address map, this solution is not practical for
system wide profiling that is always on.
This patch tries to address this with a variation to stackmap. Instead
of storing addresses, the variation stores ELF file build_id + offset.
After profiling, a user space tool will look up these functions with
build_id (to find the binary or shared library) and the offset.
I also updated bcc/cc library for the stackmap (no python/lua support yet).
You can find the work at:
https://github.com/liu-song-6/bcc/commits/bpf_get_stackid_v02
Changes v5 -> v6:
1. When kernel stack is added to stackmap with build_id, use fallback
mechanism to store ip (status == BPF_STACK_BUILD_ID_IP).
Changes v4 -> v5:
1. Only allow build_id lookup in non-nmi context. Added comment and
commit message to highlight this limitation.
2. Minor fix reported by kbuild test robot.
Changes v3 -> v4:
1. Add fallback when build_id lookup failed. In this case, status is set
to BPF_STACK_BUILD_ID_IP, and ip of this entry is saved.
2. Handle cases where vma is only part of the file (vma->vm_pgoff != 0).
Thanks to Teng for helping me identify this issue!
3. Address feedbacks for previous versions.
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'mm/process_vm_access.c')
0 files changed, 0 insertions, 0 deletions