summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/xsk_prereqs.sh
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2021-08-25 20:37:06 +0300
committerAlexei Starovoitov <ast@kernel.org>2021-08-25 20:37:06 +0300
commit35cba2988fc65239d10566edc03cc0978382c25f (patch)
treee5b1620463dac99be057e44cb7803dc7a512eada /tools/testing/selftests/bpf/xsk_prereqs.sh
parent3bbc8ee7c363a83aa192d796ad37b6bf462a2947 (diff)
parent576d47bb1a926fe8162253e0bca28e9bede8cf48 (diff)
downloadlinux-35cba2988fc65239d10566edc03cc0978382c25f.tar.xz
Merge branch 'bpf: Add bpf_task_pt_regs() helper'
Daniel Xu says: ==================== The motivation behind this helper is to access userspace pt_regs in a kprobe handler. uprobe's ctx is the userspace pt_regs. kprobe's ctx is the kernelspace pt_regs. bpf_task_pt_regs() allows accessing userspace pt_regs in a kprobe handler. The final case (kernelspace pt_regs in uprobe) is pretty rare (usermode helper) so I think that can be solved later if necessary. More concretely, this helper is useful in doing BPF-based DWARF stack unwinding. Currently the kernel can only do framepointer based stack unwinds for userspace code. This is because the DWARF state machines are too fragile to be computed in kernelspace [0]. The idea behind DWARF-based stack unwinds w/ BPF is to copy a chunk of the userspace stack (while in prog context) and send it up to userspace for unwinding (probably with libunwind) [1]. This would effectively enable profiling applications with -fomit-frame-pointer using kprobes and uprobes. [0]: https://lkml.org/lkml/2012/2/10/356 [1]: https://github.com/danobi/bpf-dwarf-walk Changes from v1: - Conwolidate BTF_ID decls for task_struct - Enable bpf_get_current_task_btf() for all prog types - Enable bpf_task_pt_regs() for all prog types - Use ASSERT_* macros instead of CHECK ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/xsk_prereqs.sh')
0 files changed, 0 insertions, 0 deletions