History

bpf: introduce BPF_PROG_QUERY command

introduce BPF_PROG_QUERY command to retrieve a set of either attached programs to given cgroup or a set of effective programs that will execute for events within a cgroup

Alexei Starovoitov committed 9 years ago

Commit 468e2f61 parent 324bda97 files · +148 −0Browse files

Showing the changes to include/uapi/linux (1 of 7 files). Show all

Unified · Split

include/uapi/linux/bpf.h+13−0
@@ -92,6 +92,7 @@ enum bpf_cmd { · 91 unmodified lines
9292 BPF_PROG_GET_FD_BY_ID,
9393 BPF_MAP_GET_FD_BY_ID,
9494 BPF_OBJ_GET_INFO_BY_FD,
95+ BPF_PROG_QUERY,
9596 };
9697
9798 enum bpf_map_type {
@@ -211,6 +212,9 @@ enum bpf_attach_type { · 113 unmodified lines
211212 /* Specify numa node during map creation */
212213 #define BPF_F_NUMA_NODE (1U << 2)
213214
215+/* flags for BPF_PROG_QUERY */
216+#define BPF_F_QUERY_EFFECTIVE (1U << 0)
217+
214218 #define BPF_OBJ_NAME_LEN 16U
215219
216220 union bpf_attr {
@@ -289,6 +293,15 @@ union bpf_attr { · 72 unmodified lines
289293 __u32 info_len;
290294 __aligned_u64 info;
291295 } info;
296+
297+ struct { /* anonymous struct used by BPF_PROG_QUERY command */
298+ __u32 target_fd; /* container object to query */
299+ __u32 attach_type;
300+ __u32 query_flags;
301+ __u32 attach_flags;
302+ __aligned_u64 prog_ids;
303+ __u32 prog_cnt;
304+ } query;
292305 } __attribute__((aligned(8)));
293306
294307 /* BPF helper function descriptions: