Lines Matching refs:d

29 	struct btf_dump *d;  in btf_dump_all_types()  local
32 d = btf_dump__new(btf, btf_dump_printf, ctx, NULL); in btf_dump_all_types()
33 err = libbpf_get_error(d); in btf_dump_all_types()
38 err = btf_dump__dump_type(d, id); in btf_dump_all_types()
44 btf_dump__free(d); in btf_dump_all_types()
136 struct btf_dump *d = NULL; in test_btf_dump_incremental() local
145 d = btf_dump__new(btf, btf_dump_printf, dump_buf_file, NULL); in test_btf_dump_incremental()
146 if (!ASSERT_OK(libbpf_get_error(d), "btf_dump__new")) in test_btf_dump_incremental()
186 err = btf_dump__dump_type(d, i); in test_btf_dump_incremental()
236 err = btf_dump__dump_type(d, i); in test_btf_dump_incremental()
254 btf_dump__free(d); in test_btf_dump_incremental()
269 static int btf_dump_data(struct btf *btf, struct btf_dump *d, in btf_dump_data() argument
294 ret = btf_dump__dump_type_data(d, type_id, ptr, ptr_sz, &opts); in btf_dump_data()
350 static void test_btf_dump_int_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_int_data() argument
362 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, int, BTF_F_COMPACT, 1234); in test_btf_dump_int_data()
363 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_int_data()
365 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, 0, "(int)1234", 1234); in test_btf_dump_int_data()
368 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT, "(int)0", 0); in test_btf_dump_int_data()
369 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_int_data()
371 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_int_data()
373 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, in test_btf_dump_int_data()
376 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, int, BTF_F_COMPACT, -4567); in test_btf_dump_int_data()
377 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_int_data()
379 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, 0, "(int)-4567", -4567); in test_btf_dump_int_data()
381 TEST_BTF_DUMP_DATA_OVER(btf, d, NULL, str, int, sizeof(int)-1, "", 1); in test_btf_dump_int_data()
389 TEST_BTF_DUMP_DATA(btf, d, NULL, str, unsigned __int128, BTF_F_COMPACT, in test_btf_dump_int_data()
392 ASSERT_OK(btf_dump_data(btf, d, "unsigned __int128", NULL, 0, &i, 16, str, in test_btf_dump_int_data()
396 TEST_BTF_DUMP_DATA(btf, d, NULL, str, __int128 unsigned, BTF_F_COMPACT, in test_btf_dump_int_data()
399 ASSERT_OK(btf_dump_data(btf, d, "__int128 unsigned", NULL, 0, &i, 16, str, in test_btf_dump_int_data()
408 static void test_btf_dump_float_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_float_data() argument
426 ASSERT_OK(btf_dump_data(btf, d, "test_float", NULL, 0, &t1, 4, str, in test_btf_dump_float_data()
428 ASSERT_OK(btf_dump_data(btf, d, "test_float", NULL, 0, &t2, 4, str, in test_btf_dump_float_data()
430 ASSERT_OK(btf_dump_data(btf, d, "test_float", NULL, 0, &t3, 4, str, in test_btf_dump_float_data()
434 ASSERT_OK(btf_dump_data(btf, d, "test_double", NULL, 0, &t4, 8, str, in test_btf_dump_float_data()
436 ASSERT_OK(btf_dump_data(btf, d, "test_double", NULL, 0, &t5, 8, str, in test_btf_dump_float_data()
438 ASSERT_OK(btf_dump_data(btf, d, "test_double", NULL, 0, &t6, 8, str, in test_btf_dump_float_data()
442 ASSERT_OK(btf_dump_data(btf, d, "test_long_double", NULL, 0, &t7, 16, in test_btf_dump_float_data()
445 ASSERT_OK(btf_dump_data(btf, d, "test_long_double", NULL, 0, &t8, 16, in test_btf_dump_float_data()
448 ASSERT_OK(btf_dump_data(btf, d, "test_long_double", NULL, 0, &t9, 16, in test_btf_dump_float_data()
453 static void test_btf_dump_char_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_char_data() argument
457 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, char, BTF_F_COMPACT, 100); in test_btf_dump_char_data()
458 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_char_data()
460 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, 0, "(char)100", 100); in test_btf_dump_char_data()
462 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT, in test_btf_dump_char_data()
464 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_char_data()
466 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_char_data()
468 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_NONAME | BTF_F_ZERO, in test_btf_dump_char_data()
470 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, 0, "(char)0", 0); in test_btf_dump_char_data()
472 TEST_BTF_DUMP_DATA_OVER(btf, d, NULL, str, char, sizeof(char)-1, "", 100); in test_btf_dump_char_data()
475 static void test_btf_dump_typedef_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_typedef_data() argument
479 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, uint64_t, BTF_F_COMPACT, 100); in test_btf_dump_typedef_data()
480 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
482 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, 0, "(u64)1", 1); in test_btf_dump_typedef_data()
484 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT, "(u64)0", 0); in test_btf_dump_typedef_data()
485 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
487 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_typedef_data()
489 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, in test_btf_dump_typedef_data()
492 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, 0, "(u64)0", 0); in test_btf_dump_typedef_data()
495 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, atomic_t, BTF_F_COMPACT, in test_btf_dump_typedef_data()
497 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
499 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, 0, in test_btf_dump_typedef_data()
505 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT, "(atomic_t){}", in test_btf_dump_typedef_data()
507 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
509 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, 0, in test_btf_dump_typedef_data()
513 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_typedef_data()
516 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, in test_btf_dump_typedef_data()
519 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_ZERO, in test_btf_dump_typedef_data()
526 TEST_BTF_DUMP_DATA_OVER(btf, d, NULL, str, atomic_t, sizeof(atomic_t)-1, in test_btf_dump_typedef_data()
530 static void test_btf_dump_enum_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_enum_data() argument
534 TEST_BTF_DUMP_DATA_C(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT, in test_btf_dump_enum_data()
536 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT, in test_btf_dump_enum_data()
538 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
542 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, 0, in test_btf_dump_enum_data()
545 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
548 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
552 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
555 TEST_BTF_DUMP_DATA_C(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT, 2000); in test_btf_dump_enum_data()
556 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
559 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, 0, in test_btf_dump_enum_data()
562 TEST_BTF_DUMP_DATA_OVER(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
566 static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_struct_data() argument
582 TEST_BTF_DUMP_DATA_C(btf, d, "struct", str, struct btf_enum, BTF_F_COMPACT, in test_btf_dump_struct_data()
584 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
588 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, 0, in test_btf_dump_struct_data()
594 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
598 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
603 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, BTF_F_COMPACT, in test_btf_dump_struct_data()
606 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
610 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, 0, in test_btf_dump_struct_data()
614 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
618 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
627 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, BTF_F_COMPACT, in test_btf_dump_struct_data()
630 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, 0, in test_btf_dump_struct_data()
636 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, BTF_F_COMPACT, in test_btf_dump_struct_data()
639 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, 0, in test_btf_dump_struct_data()
650 ret = btf_dump__dump_type_data(d, type_id, fops, type_sz, &opts); in test_btf_dump_struct_data()
662 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
665 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, in test_btf_dump_struct_data()
669 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, 0, in test_btf_dump_struct_data()
679 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
683 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
688 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, BTF_F_COMPACT, in test_btf_dump_struct_data()
691 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, in test_btf_dump_struct_data()
695 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, 0, in test_btf_dump_struct_data()
707 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, BTF_F_COMPACT, in test_btf_dump_struct_data()
710 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, 0, in test_btf_dump_struct_data()
723 TEST_BTF_DUMP_DATA_C(btf, d, "struct", str, struct bpf_insn, BTF_F_COMPACT, in test_btf_dump_struct_data()
725 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_insn, in test_btf_dump_struct_data()
730 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_insn, 0, in test_btf_dump_struct_data()
741 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_insn, BTF_F_COMPACT, in test_btf_dump_struct_data()
752 ret = btf_dump__dump_type_data(d, type_id, zero_data, type_sz, &opts); in test_btf_dump_struct_data()
761 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_sock_ops, BTF_F_COMPACT, in test_btf_dump_struct_data()
766 TEST_BTF_DUMP_DATA(btf, d, "union", str, union bpf_iter_link_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
779 ret = btf_dump__dump_type_data(d, type_id, skb, type_sz, &opts); in test_btf_dump_struct_data()
791 TEST_BTF_DUMP_DATA_OVER(btf, d, "struct", str, struct bpf_sock_ops, in test_btf_dump_struct_data()
795 TEST_BTF_DUMP_DATA_OVER(btf, d, "struct", str, struct bpf_sock_ops, in test_btf_dump_struct_data()
801 static void test_btf_dump_var_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_var_data() argument
805 TEST_BTF_DUMP_VAR(btf, d, NULL, str, "cpu_number", int, BTF_F_COMPACT, in test_btf_dump_var_data()
808 TEST_BTF_DUMP_VAR(btf, d, NULL, str, "cpu_profile_flip", int, BTF_F_COMPACT, in test_btf_dump_var_data()
812 static void test_btf_datasec(struct btf *btf, struct btf_dump *d, char *str, in test_btf_datasec() argument
831 ret = btf_dump__dump_type_data(d, type_id, data, data_sz, &opts); in test_btf_datasec()
842 struct btf_dump *d; in test_btf_dump_datasec_data() local
848 d = btf_dump__new(btf, btf_dump_snprintf, str, NULL); in test_btf_dump_datasec_data()
849 if (!ASSERT_OK_PTR(d, "could not create BTF dump")) in test_btf_dump_datasec_data()
852 test_btf_datasec(btf, d, str, "license", in test_btf_dump_datasec_data()
856 btf_dump__free(d); in test_btf_dump_datasec_data()
862 struct btf_dump *d; in test_btf_dump() local
881 d = btf_dump__new(btf, btf_dump_snprintf, str, NULL); in test_btf_dump()
882 if (!ASSERT_OK_PTR(d, "could not create BTF dump")) in test_btf_dump()
887 test_btf_dump_int_data(btf, d, str); in test_btf_dump()
889 test_btf_dump_float_data(btf, d, str); in test_btf_dump()
891 test_btf_dump_char_data(btf, d, str); in test_btf_dump()
893 test_btf_dump_typedef_data(btf, d, str); in test_btf_dump()
895 test_btf_dump_enum_data(btf, d, str); in test_btf_dump()
897 test_btf_dump_struct_data(btf, d, str); in test_btf_dump()
899 test_btf_dump_var_data(btf, d, str); in test_btf_dump()
900 btf_dump__free(d); in test_btf_dump()