break;
PRINT_FIELD_XVAL(", ", attr, expected_attach_type, bpf_attach_type,
"BPF_???");
+
+ /*
+ * The following seven fields were introduced by Linux commits
+ * v5.0-rc1~129^2~209^2~16^2~8 and v5.0-rc1~129^2~114^2~5^2~6.
+ */
+ if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd))
+ break;
+ PRINT_FIELD_FD(", ", attr, prog_btf_fd, tcp);
+ PRINT_FIELD_U(", ", attr, func_info_rec_size);
+ PRINT_FIELD_ADDR64(", ", attr, func_info);
+ PRINT_FIELD_U(", ", attr, func_info_cnt);
+ PRINT_FIELD_U(", ", attr, line_info_rec_size);
+ PRINT_FIELD_ADDR64(", ", attr, line_info);
+ PRINT_FIELD_U(", ", attr, line_info_cnt);
}
END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD)
char prog_name[BPF_OBJ_NAME_LEN];
uint32_t prog_ifindex;
uint32_t expected_attach_type;
+ uint32_t prog_btf_fd;
+ uint32_t func_info_rec_size;
+ uint64_t ATTRIBUTE_ALIGNED(8) func_info;
+ uint32_t func_info_cnt;
+ uint32_t line_info_rec_size;
+ uint64_t ATTRIBUTE_ALIGNED(8) line_info;
+ uint32_t line_info_cnt;
};
# define BPF_PROG_LOAD_struct_size \
- offsetofend(struct BPF_PROG_LOAD_struct, expected_attach_type)
-# define expected_BPF_PROG_LOAD_struct_size 72
+ offsetofend(struct BPF_PROG_LOAD_struct, line_info_cnt)
+# define expected_BPF_PROG_LOAD_struct_size 108
struct BPF_OBJ_PIN_struct {
uint64_t ATTRIBUTE_ALIGNED(8) pathname;
printf(", prog_ifindex=0");
if (size > offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type))
printf(", expected_attach_type=BPF_CGROUP_INET_INGRESS");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd))
+ printf(", prog_btf_fd=0</dev/null>");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_rec_size))
+ printf(", func_info_rec_size=0");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info))
+ printf(", func_info=NULL");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_cnt))
+ printf(", func_info_cnt=0");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_rec_size))
+ printf(", line_info_rec_size=0");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info))
+ printf(", line_info=NULL");
+ if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_cnt))
+ printf(", line_info_cnt=0");
printf("}, %zu) = ", size);
if (rc >= 0)
printf("%ld<anon_inode:bpf-prog>\n", rc);
.init_fn = init_BPF_PROG_LOAD_attr4,
.print_fn = print_BPF_PROG_LOAD_attr4
},
+ { /* 5 */
+ .data = { .BPF_PROG_LOAD_data = {
+ .prog_flags = 2,
+ .expected_attach_type = 17,
+ .prog_btf_fd = 0xbadc0ded,
+ .func_info_rec_size = 0xdad1bef2,
+ .func_info = 0xfac1fed2fac3fed4,
+ .func_info_cnt = 0xdad3bef4,
+ .line_info_rec_size = 0xdad5bef6,
+ .line_info = 0xfac5fed5fac7fed8,
+ .line_info_cnt = 0xdad7bef8
+ } },
+ .size = offsetofend(struct BPF_PROG_LOAD_struct,
+ line_info_cnt),
+ .str = "prog_type=BPF_PROG_TYPE_UNSPEC"
+ ", insn_cnt=0"
+ ", insns=NULL"
+ ", license=NULL"
+ ", log_level=0"
+ ", log_size=0"
+ ", log_buf=NULL"
+ ", kern_version=KERNEL_VERSION(0, 0, 0)"
+ ", prog_flags=BPF_F_ANY_ALIGNMENT"
+ ", prog_name=\"\""
+ ", prog_ifindex=0"
+ ", expected_attach_type=BPF_FLOW_DISSECTOR"
+ ", prog_btf_fd=-1159983635"
+ ", func_info_rec_size=3671178994"
+ ", func_info=0xfac1fed2fac3fed4"
+ ", func_info_cnt=3671310068"
+ ", line_info_rec_size=3671441142"
+ ", line_info=0xfac5fed5fac7fed8"
+ ", line_info_cnt=3671572216"
+ },
};
static void
", prog_ifindex=0"
", expected_attach_type="
#if XLAT_RAW
- "0}"
+ "0"
#elif XLAT_VERBOSE
- "0 /* BPF_CGROUP_INET_INGRESS */}"
+ "0 /* BPF_CGROUP_INET_INGRESS */"
#else /* XLAT_ABBREV */
- "BPF_CGROUP_INET_INGRESS}"
+ "BPF_CGROUP_INET_INGRESS"
#endif
- );
+ ", prog_btf_fd=0"
+ ", func_info_rec_size=0"
+ ", func_info=NULL"
+ ", func_info_cnt=0"
+ ", line_info_rec_size=0"
+ ", line_info=NULL"
+ ", line_info_cnt=0}");
}
int