]> asedeno.scripts.mit.edu Git - linux.git/commit
bpf: add BTF ids in procfs for file descriptors to BTF objects
authorQuentin Monnet <quentin.monnet@netronome.com>
Tue, 20 Aug 2019 13:53:46 +0000 (14:53 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 20 Aug 2019 14:19:12 +0000 (16:19 +0200)
commit3481e64bbe9876e359aec74c9e93039b94f678b0
treed559bb98a7c7bc23bc2aea6bb69d32880c5679cb
parentede6bc88d6bbe16a938de2b00f60f4e03768c988
bpf: add BTF ids in procfs for file descriptors to BTF objects

Implement the show_fdinfo hook for BTF FDs file operations, and make it
print the id of the BTF object. This allows for a quick retrieval of the
BTF id from its FD; or it can help understanding what type of object
(BTF) the file descriptor points to.

v2:
- Do not expose data_size, only btf_id, in FD info.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/btf.c