Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libbpf: Add support for dynamic tracepoint
Dynamic tracepoints can be created using debugfs, perf or similar tools. For example: $ perf probe -a 'tcp_listendrop sk' This command creates a new tracepoint under debugfs: $ ls /sys/kernel/debug/tracing/events/probe/tcp_listendrop/ enable filter format hist id trigger Notably, the probed function tcp_listendrop() is an inlined kernel function. Although this dynamic tracepoint appears as a tracepoint, it is internally implemented as a kprobe. Therefore, if we want to attach a bpf prog to it, the bpf prog must be loaded as a kprobe prog. The primary motivation for adding support for dynamic tracepoints is to simplify tracing of inlined kernel functions using BPF tools, such as bpftrace. By leveraging tools like perf, users can create a dynamic tracepoint for an inlined kernel function and then attach a BPF program to it. To achieve this, a new section, SEC("kprobe/SUBSYSTEM/PROBE"), has been introduced. Suggested-by: Jiri Olsa <olsajiri@gmail.com> Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Cc: Daniel Xu <dxu@dxuuu.xyz>
- Loading branch information