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
Showing the changes to include/uapi/linux (1 of 7 files). Show all
Unified · Split
| @@ -92,6 +92,7 @@ enum bpf_cmd { · 91 unmodified lines | ||
| 92 | 92 | BPF_PROG_GET_FD_BY_ID, |
| 93 | 93 | BPF_MAP_GET_FD_BY_ID, |
| 94 | 94 | BPF_OBJ_GET_INFO_BY_FD, |
| 95 | + BPF_PROG_QUERY, | |
| 95 | 96 | }; |
| 96 | 97 | |
| 97 | 98 | enum bpf_map_type { |
| @@ -211,6 +212,9 @@ enum bpf_attach_type { · 113 unmodified lines | ||
| 211 | 212 | /* Specify numa node during map creation */ |
| 212 | 213 | #define BPF_F_NUMA_NODE (1U << 2) |
| 213 | 214 | |
| 215 | +/* flags for BPF_PROG_QUERY */ | |
| 216 | +#define BPF_F_QUERY_EFFECTIVE (1U << 0) | |
| 217 | + | |
| 214 | 218 | #define BPF_OBJ_NAME_LEN 16U |
| 215 | 219 | |
| 216 | 220 | union bpf_attr { |
| @@ -289,6 +293,15 @@ union bpf_attr { · 72 unmodified lines | ||
| 289 | 293 | __u32 info_len; |
| 290 | 294 | __aligned_u64 info; |
| 291 | 295 | } 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; | |
| 292 | 305 | } __attribute__((aligned(8))); |
| 293 | 306 | |
| 294 | 307 | /* BPF helper function descriptions: |