summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2018-05-24 11:21:09 -0700
committerAlexei Starovoitov <ast@kernel.org>2018-05-24 18:18:19 -0700
commit41bdc4b40ed6fb26c6acc655ed9a243a348709c9 (patch)
tree84be65f3afa34f4313729d0c7fc7141ca51a0243 /tools/lib
parentf8d959a5b188dc81e57a6bac34a1b2986f61e2fd (diff)
downloadop-kernel-dev-41bdc4b40ed6fb26c6acc655ed9a243a348709c9.zip
op-kernel-dev-41bdc4b40ed6fb26c6acc655ed9a243a348709c9.tar.gz
bpf: introduce bpf subcommand BPF_TASK_FD_QUERY
Currently, suppose a userspace application has loaded a bpf program and attached it to a tracepoint/kprobe/uprobe, and a bpf introspection tool, e.g., bpftool, wants to show which bpf program is attached to which tracepoint/kprobe/uprobe. Such attachment information will be really useful to understand the overall bpf deployment in the system. There is a name field (16 bytes) for each program, which could be used to encode the attachment point. There are some drawbacks for this approaches. First, bpftool user (e.g., an admin) may not really understand the association between the name and the attachment point. Second, if one program is attached to multiple places, encoding a proper name which can imply all these attachments becomes difficult. This patch introduces a new bpf subcommand BPF_TASK_FD_QUERY. Given a pid and fd, if the <pid, fd> is associated with a tracepoint/kprobe/uprobe perf event, BPF_TASK_FD_QUERY will return . prog_id . tracepoint name, or . k[ret]probe funcname + offset or kernel addr, or . u[ret]probe filename + offset to the userspace. The user can use "bpftool prog" to find more information about bpf program itself with prog_id. Acked-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud