diff options
author | Yonghong Song <yhs@fb.com> | 2020-08-21 11:44:18 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-21 14:01:39 -0700 |
commit | 6b0a249a301e2af9adda84adbced3a2988248b95 (patch) | |
tree | 889c95fb17b222cd9b2d1809845b6e988692525b /tools/include | |
parent | 149cb3395504736485df1b93133e710dcf215c56 (diff) | |
download | linux-stable-6b0a249a301e2af9adda84adbced3a2988248b95.tar.gz linux-stable-6b0a249a301e2af9adda84adbced3a2988248b95.tar.bz2 linux-stable-6b0a249a301e2af9adda84adbced3a2988248b95.zip |
bpf: Implement link_query for bpf iterators
This patch implemented bpf_link callback functions
show_fdinfo and fill_link_info to support link_query
interface.
The general interface for show_fdinfo and fill_link_info
will print/fill the target_name. Each targets can
register show_fdinfo and fill_link_info callbacks
to print/fill more target specific information.
For example, the below is a fdinfo result for a bpf
task iterator.
$ cat /proc/1749/fdinfo/7
pos: 0
flags: 02000000
mnt_id: 14
link_type: iter
link_id: 11
prog_tag: 990e1f8152f7e54f
prog_id: 59
target_name: task
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200821184418.574122-1-yhs@fb.com
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/uapi/linux/bpf.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 0480f893facd..a1bbaff7a0af 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -4071,6 +4071,13 @@ struct bpf_link_info { __u64 cgroup_id; __u32 attach_type; } cgroup; + struct { + __aligned_u64 target_name; /* in/out: target_name buffer ptr */ + __u32 target_name_len; /* in/out: target_name buffer len */ + union { + __u32 map_id; + } map; + } iter; struct { __u32 netns_ino; __u32 attach_type; |