PRINT_FIELD_DEV(", ", info, netns_dev);
PRINT_FIELD_U(", ", info, netns_ino);
+ /*
+ * The next three fields were introduced by Linux commits
+ * v4.18-rc1~114^2~223^2~21^2~4 and v4.18-rc1~114^2~148^2~7^2~2.
+ */
+ if (len <= offsetof(struct bpf_map_info_struct, btf_id))
+ goto print_bpf_map_info_end;
+ PRINT_FIELD_U(", ", info, btf_id);
+ PRINT_FIELD_U(", ", info, btf_key_type_id);
+ PRINT_FIELD_U(", ", info, btf_value_type_id);
+
decode_attr_extra_data(tcp, info_buf, size, bpf_map_info_struct_size);
print_bpf_map_info_end:
*/
uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */
uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */
+ uint32_t btf_id;
+ uint32_t btf_key_type_id;
+ uint32_t btf_value_type_id;
};
# define bpf_map_info_struct_size \
- sizeof(struct bpf_map_info_struct)
-# define expected_bpf_map_info_struct_size 64
+ offsetofend(struct bpf_map_info_struct, btf_value_type_id)
+# define expected_bpf_map_info_struct_size 76
struct bpf_prog_info_struct {
uint32_t type;
if (bpf_map_get_info_attr.info_len >
offsetof(struct bpf_map_info_struct, netns_ino))
printf(", netns_ino=%" PRIu64, map_info->netns_ino);
+ if (bpf_map_get_info_attr.info_len >
+ offsetof(struct bpf_map_info_struct, btf_id))
+ PRINT_FIELD_U(", ", *map_info, btf_id);
+ if (bpf_map_get_info_attr.info_len >
+ offsetof(struct bpf_map_info_struct, btf_key_type_id))
+ PRINT_FIELD_U(", ", *map_info, btf_key_type_id);
+ if (bpf_map_get_info_attr.info_len >
+ offsetof(struct bpf_map_info_struct, btf_value_type_id))
+ PRINT_FIELD_U(", ", *map_info, btf_value_type_id);
printf("}");
#else /* !VERBOSE */
printf("%p", map_info);