uint32_t jited_prog_len;
uint32_t xlated_prog_len;
uint32_t nr_map_ids;
+
+ uint32_t nr_jited_ksyms;
+ uint32_t nr_jited_func_lens;
+ uint64_t jited_ksyms;
+ uint64_t jited_func_lens;
};
static void
saved->jited_prog_len = info.jited_prog_len;
saved->xlated_prog_len = info.xlated_prog_len;
saved->nr_map_ids = info.nr_map_ids;
+ saved->nr_jited_ksyms = info.nr_jited_ksyms;
+ saved->nr_jited_func_lens = info.nr_jited_func_lens;
+ saved->jited_ksyms = info.jited_ksyms;
+ saved->jited_func_lens = info.jited_func_lens;
return;
}
PRINT_FIELD_DEV(", ", info, netns_dev);
PRINT_FIELD_U(", ", info, netns_ino);
+ /*
+ * The next four fields were introduced by Linux commits
+ * v4.18-rc1~114^2~148^2~3^2~6 and v4.18-rc1~114^2~148^2~3^2~2.
+ */
+ if (len <= offsetof(struct bpf_prog_info_struct, nr_jited_ksyms))
+ goto print_bpf_prog_info_end;
+
+ tprints(", nr_jited_ksyms=");
+ if (saved->nr_jited_ksyms != info.nr_jited_ksyms)
+ tprintf("%" PRIu32 " => ", saved->nr_jited_ksyms);
+ tprintf("%" PRIu32, info.nr_jited_ksyms);
+
+ tprints(", nr_jited_func_lens=");
+ if (saved->nr_jited_func_lens != info.nr_jited_func_lens)
+ tprintf("%" PRIu32 " => ", saved->nr_jited_func_lens);
+ tprintf("%" PRIu32, info.nr_jited_func_lens);
+
+ tprints(", jited_ksyms=");
+ if (saved->jited_ksyms != info.jited_ksyms) {
+ printaddr64(saved->jited_ksyms);
+ tprints(" => ");
+ }
+ printaddr64(info.jited_ksyms);
+
+ tprints(", jited_func_lens=");
+ if (saved->jited_func_lens != info.jited_func_lens) {
+ printaddr64(saved->jited_func_lens);
+ tprints(" => ");
+ }
+ printaddr64(info.jited_func_lens);
+
decode_attr_extra_data(tcp, info_buf, size, bpf_prog_info_struct_size);
print_bpf_prog_info_end:
*/
uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
+ uint32_t nr_jited_ksyms;
+ uint32_t nr_jited_func_lens;
+ uint64_t ATTRIBUTE_ALIGNED(8) jited_ksyms;
+ uint64_t ATTRIBUTE_ALIGNED(8) jited_func_lens;
};
# define bpf_prog_info_struct_size \
sizeof(struct bpf_prog_info_struct)
-# define expected_bpf_prog_info_struct_size 104
+# define expected_bpf_prog_info_struct_size 128
#endif /* !STRACE_BPF_ATTR_H */
memset(prog_info, 0, PROG_INFO_SZ);
for (unsigned int i = 0; i < 4; i++) {
prog_info->jited_prog_len = 0;
+ prog_info->nr_jited_ksyms = 0;
+ prog_info->nr_jited_func_lens = 0;
memset(prog_info + 1, 0, PROG_INFO_SZ - sizeof(*prog_info));
switch (i) {
case 1:
offsetof(struct bpf_prog_info_struct, netns_ino))
printf(", netns_ino=%" PRIu64, prog_info->netns_ino);
+ if (bpf_prog_get_info_attr.info_len >
+ offsetof(struct bpf_prog_info_struct, nr_jited_ksyms)) {
+ printf(", nr_jited_ksyms=0");
+ if (prog_info->nr_jited_ksyms)
+ printf(" => %u", prog_info->nr_jited_ksyms);
+ }
+ if (bpf_prog_get_info_attr.info_len >
+ offsetof(struct bpf_prog_info_struct, nr_jited_func_lens)) {
+ printf(", nr_jited_func_lens=0");
+ if (prog_info->nr_jited_func_lens)
+ printf(" => %u", prog_info->nr_jited_func_lens);
+ }
+ if (bpf_prog_get_info_attr.info_len >
+ offsetof(struct bpf_prog_info_struct, jited_ksyms))
+ printf(", jited_ksyms=NULL");
+ if (bpf_prog_get_info_attr.info_len >
+ offsetof(struct bpf_prog_info_struct, jited_func_lens))
+ printf(", jited_func_lens=NULL");
+
printf("}");
# else /* !VERBOSE */
printf("%p", prog_info);