diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2021-04-13 12:16:06 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-04-14 04:18:57 +0300 |
commit | 441e8c66b23e027c00ccebd70df9fd933918eefe (patch) | |
tree | a63bbd06a0039e18a5a8f2c972c16e9d47e46f2b /kernel | |
parent | db16c1fe92d7ba7d39061faef897842baee2c887 (diff) | |
download | linux-441e8c66b23e027c00ccebd70df9fd933918eefe.tar.xz |
bpf: Return target info when a tracing bpf_link is queried
There is currently no way to discover the target of a tracing program
attachment after the fact. Add this information to bpf_link_info and return
it when querying the bpf_link fd.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210413091607.58945-1-toke@redhat.com
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/syscall.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 6428634da57e..fd495190115e 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -2551,6 +2551,9 @@ static int bpf_tracing_link_fill_link_info(const struct bpf_link *link, container_of(link, struct bpf_tracing_link, link); info->tracing.attach_type = tr_link->attach_type; + bpf_trampoline_unpack_key(tr_link->trampoline->key, + &info->tracing.target_obj_id, + &info->tracing.target_btf_id); return 0; } |