Lines Matching refs:d
31 struct btf_dump *d; in btf_dump_all_types() local
34 d = btf_dump__new(btf, NULL, opts, btf_dump_printf); in btf_dump_all_types()
35 err = libbpf_get_error(d); in btf_dump_all_types()
40 err = btf_dump__dump_type(d, id); in btf_dump_all_types()
46 btf_dump__free(d); in btf_dump_all_types()
139 struct btf_dump *d = NULL; in test_btf_dump_incremental() local
150 d = btf_dump__new(btf, NULL, &opts, btf_dump_printf); in test_btf_dump_incremental()
151 if (!ASSERT_OK(libbpf_get_error(d), "btf_dump__new")) in test_btf_dump_incremental()
175 err = btf_dump__dump_type(d, i); in test_btf_dump_incremental()
214 err = btf_dump__dump_type(d, i); in test_btf_dump_incremental()
231 btf_dump__free(d); in test_btf_dump_incremental()
246 static int btf_dump_data(struct btf *btf, struct btf_dump *d, in btf_dump_data() argument
271 ret = btf_dump__dump_type_data(d, type_id, ptr, ptr_sz, &opts); in btf_dump_data()
327 static void test_btf_dump_int_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_int_data() argument
339 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, int, BTF_F_COMPACT, 1234); in test_btf_dump_int_data()
340 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_int_data()
342 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, 0, "(int)1234", 1234); in test_btf_dump_int_data()
345 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT, "(int)0", 0); in test_btf_dump_int_data()
346 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_int_data()
348 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_int_data()
350 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, in test_btf_dump_int_data()
353 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, int, BTF_F_COMPACT, -4567); in test_btf_dump_int_data()
354 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_int_data()
356 TEST_BTF_DUMP_DATA(btf, d, NULL, str, int, 0, "(int)-4567", -4567); in test_btf_dump_int_data()
358 TEST_BTF_DUMP_DATA_OVER(btf, d, NULL, str, int, sizeof(int)-1, "", 1); in test_btf_dump_int_data()
361 TEST_BTF_DUMP_DATA(btf, d, NULL, str, __int128, BTF_F_COMPACT, in test_btf_dump_int_data()
364 ASSERT_OK(btf_dump_data(btf, d, "__int128", NULL, 0, &i, 16, str, in test_btf_dump_int_data()
370 static void test_btf_dump_float_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_float_data() argument
388 ASSERT_OK(btf_dump_data(btf, d, "test_float", NULL, 0, &t1, 4, str, in test_btf_dump_float_data()
390 ASSERT_OK(btf_dump_data(btf, d, "test_float", NULL, 0, &t2, 4, str, in test_btf_dump_float_data()
392 ASSERT_OK(btf_dump_data(btf, d, "test_float", NULL, 0, &t3, 4, str, in test_btf_dump_float_data()
396 ASSERT_OK(btf_dump_data(btf, d, "test_double", NULL, 0, &t4, 8, str, in test_btf_dump_float_data()
398 ASSERT_OK(btf_dump_data(btf, d, "test_double", NULL, 0, &t5, 8, str, in test_btf_dump_float_data()
400 ASSERT_OK(btf_dump_data(btf, d, "test_double", NULL, 0, &t6, 8, str, in test_btf_dump_float_data()
404 ASSERT_OK(btf_dump_data(btf, d, "test_long_double", NULL, 0, &t7, 16, in test_btf_dump_float_data()
407 ASSERT_OK(btf_dump_data(btf, d, "test_long_double", NULL, 0, &t8, 16, in test_btf_dump_float_data()
410 ASSERT_OK(btf_dump_data(btf, d, "test_long_double", NULL, 0, &t9, 16, in test_btf_dump_float_data()
415 static void test_btf_dump_char_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_char_data() argument
419 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, char, BTF_F_COMPACT, 100); in test_btf_dump_char_data()
420 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_char_data()
422 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, 0, "(char)100", 100); in test_btf_dump_char_data()
424 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT, in test_btf_dump_char_data()
426 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_char_data()
428 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_char_data()
430 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, BTF_F_COMPACT | BTF_F_NONAME | BTF_F_ZERO, in test_btf_dump_char_data()
432 TEST_BTF_DUMP_DATA(btf, d, NULL, str, char, 0, "(char)0", 0); in test_btf_dump_char_data()
434 TEST_BTF_DUMP_DATA_OVER(btf, d, NULL, str, char, sizeof(char)-1, "", 100); in test_btf_dump_char_data()
437 static void test_btf_dump_typedef_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_typedef_data() argument
441 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, uint64_t, BTF_F_COMPACT, 100); in test_btf_dump_typedef_data()
442 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
444 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, 0, "(u64)1", 1); in test_btf_dump_typedef_data()
446 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT, "(u64)0", 0); in test_btf_dump_typedef_data()
447 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
449 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_typedef_data()
451 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, in test_btf_dump_typedef_data()
454 TEST_BTF_DUMP_DATA(btf, d, NULL, str, u64, 0, "(u64)0", 0); in test_btf_dump_typedef_data()
457 TEST_BTF_DUMP_DATA_C(btf, d, NULL, str, atomic_t, BTF_F_COMPACT, in test_btf_dump_typedef_data()
459 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
461 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, 0, in test_btf_dump_typedef_data()
467 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT, "(atomic_t){}", in test_btf_dump_typedef_data()
469 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT | BTF_F_NONAME, in test_btf_dump_typedef_data()
471 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, 0, in test_btf_dump_typedef_data()
475 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_COMPACT | BTF_F_ZERO, in test_btf_dump_typedef_data()
478 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, in test_btf_dump_typedef_data()
481 TEST_BTF_DUMP_DATA(btf, d, NULL, str, atomic_t, BTF_F_ZERO, in test_btf_dump_typedef_data()
488 TEST_BTF_DUMP_DATA_OVER(btf, d, NULL, str, atomic_t, sizeof(atomic_t)-1, in test_btf_dump_typedef_data()
492 static void test_btf_dump_enum_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_enum_data() argument
496 TEST_BTF_DUMP_DATA_C(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT, in test_btf_dump_enum_data()
498 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT, in test_btf_dump_enum_data()
500 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
504 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, 0, in test_btf_dump_enum_data()
507 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
510 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
514 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
517 TEST_BTF_DUMP_DATA_C(btf, d, "enum", str, enum bpf_cmd, BTF_F_COMPACT, 2000); in test_btf_dump_enum_data()
518 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
521 TEST_BTF_DUMP_DATA(btf, d, "enum", str, enum bpf_cmd, 0, in test_btf_dump_enum_data()
524 TEST_BTF_DUMP_DATA_OVER(btf, d, "enum", str, enum bpf_cmd, in test_btf_dump_enum_data()
528 static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_struct_data() argument
544 TEST_BTF_DUMP_DATA_C(btf, d, "struct", str, struct btf_enum, BTF_F_COMPACT, in test_btf_dump_struct_data()
546 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
550 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, 0, in test_btf_dump_struct_data()
556 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
560 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
565 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, BTF_F_COMPACT, in test_btf_dump_struct_data()
568 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
572 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, 0, in test_btf_dump_struct_data()
576 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
580 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct btf_enum, in test_btf_dump_struct_data()
589 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, BTF_F_COMPACT, in test_btf_dump_struct_data()
592 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, 0, in test_btf_dump_struct_data()
598 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, BTF_F_COMPACT, in test_btf_dump_struct_data()
601 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct list_head, 0, in test_btf_dump_struct_data()
612 ret = btf_dump__dump_type_data(d, type_id, fops, type_sz, &opts); in test_btf_dump_struct_data()
624 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
627 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, in test_btf_dump_struct_data()
631 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, 0, in test_btf_dump_struct_data()
641 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
645 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_prog_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
650 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, BTF_F_COMPACT, in test_btf_dump_struct_data()
653 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, in test_btf_dump_struct_data()
657 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, 0, in test_btf_dump_struct_data()
669 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, BTF_F_COMPACT, in test_btf_dump_struct_data()
672 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct __sk_buff, 0, in test_btf_dump_struct_data()
685 TEST_BTF_DUMP_DATA_C(btf, d, "struct", str, struct bpf_insn, BTF_F_COMPACT, in test_btf_dump_struct_data()
687 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_insn, in test_btf_dump_struct_data()
692 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_insn, 0, in test_btf_dump_struct_data()
703 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_insn, BTF_F_COMPACT, in test_btf_dump_struct_data()
714 ret = btf_dump__dump_type_data(d, type_id, zero_data, type_sz, &opts); in test_btf_dump_struct_data()
723 TEST_BTF_DUMP_DATA(btf, d, "struct", str, struct bpf_sock_ops, BTF_F_COMPACT, in test_btf_dump_struct_data()
728 TEST_BTF_DUMP_DATA(btf, d, "union", str, union bpf_iter_link_info, BTF_F_COMPACT, in test_btf_dump_struct_data()
741 ret = btf_dump__dump_type_data(d, type_id, skb, type_sz, &opts); in test_btf_dump_struct_data()
753 TEST_BTF_DUMP_DATA_OVER(btf, d, "struct", str, struct bpf_sock_ops, in test_btf_dump_struct_data()
757 TEST_BTF_DUMP_DATA_OVER(btf, d, "struct", str, struct bpf_sock_ops, in test_btf_dump_struct_data()
763 static void test_btf_dump_var_data(struct btf *btf, struct btf_dump *d, in test_btf_dump_var_data() argument
766 TEST_BTF_DUMP_VAR(btf, d, NULL, str, "cpu_number", int, BTF_F_COMPACT, in test_btf_dump_var_data()
768 TEST_BTF_DUMP_VAR(btf, d, NULL, str, "cpu_profile_flip", int, BTF_F_COMPACT, in test_btf_dump_var_data()
772 static void test_btf_datasec(struct btf *btf, struct btf_dump *d, char *str, in test_btf_datasec() argument
791 ret = btf_dump__dump_type_data(d, type_id, data, data_sz, &opts); in test_btf_datasec()
803 struct btf_dump *d; in test_btf_dump_datasec_data() local
808 d = btf_dump__new(btf, NULL, &opts, btf_dump_snprintf); in test_btf_dump_datasec_data()
809 if (!ASSERT_OK_PTR(d, "could not create BTF dump")) in test_btf_dump_datasec_data()
812 test_btf_datasec(btf, d, str, "license", in test_btf_dump_datasec_data()
820 struct btf_dump *d; in test_btf_dump() local
839 d = btf_dump__new(btf, NULL, &opts, btf_dump_snprintf); in test_btf_dump()
840 if (!ASSERT_OK_PTR(d, "could not create BTF dump")) in test_btf_dump()
845 test_btf_dump_int_data(btf, d, str); in test_btf_dump()
847 test_btf_dump_float_data(btf, d, str); in test_btf_dump()
849 test_btf_dump_char_data(btf, d, str); in test_btf_dump()
851 test_btf_dump_typedef_data(btf, d, str); in test_btf_dump()
853 test_btf_dump_enum_data(btf, d, str); in test_btf_dump()
855 test_btf_dump_struct_data(btf, d, str); in test_btf_dump()
857 test_btf_dump_var_data(btf, d, str); in test_btf_dump()
858 btf_dump__free(d); in test_btf_dump()