Re: [PATCH v2 bpf-next 03/13] selftests/bpf: test distilled base, split BTF generation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2024-04-24 at 16:47 +0100, Alan Maguire wrote:


[...]

> +static void test_distilled_base(void)
> +{
> 

[...]

> +
> +	VALIDATE_RAW_BTF(
> +		btf1,
> +		"[1] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED",
> +		"[2] PTR '(anon)' type_id=1",
> +		"[3] STRUCT 's1' size=8 vlen=1\n"
> +		"\t'f1' type_id=2 bits_offset=0",
> +		"[4] STRUCT '(anon)' size=12 vlen=2\n"
> +		"\t'f1' type_id=1 bits_offset=0\n"
> +		"\t'f2' type_id=3 bits_offset=32",
> +		"[5] INT 'unsigned int' size=4 bits_offset=0 nr_bits=32 encoding=(none)",
> +		"[6] UNION 'u1' size=12 vlen=2\n"
> +		"\t'f1' type_id=1 bits_offset=0\n"
> +		"\t'f2' type_id=2 bits_offset=0",
> +		"[7] UNION '(anon)' size=4 vlen=1\n"
> +		"\t'f1' type_id=1 bits_offset=0",
> +		"[8] ENUM 'e1' encoding=UNSIGNED size=4 vlen=1\n"
> +		"\t'v1' val=1",
> +		"[9] ENUM '(anon)' encoding=UNSIGNED size=4 vlen=1\n"
> +		"\t'av1' val=2",
> +		"[10] ENUM64 'e641' encoding=SIGNED size=8 vlen=1\n"
> +		"\t'v1' val=1024",
> +		"[11] ENUM64 '(anon)' encoding=SIGNED size=8 vlen=1\n"
> +		"\t'v1' val=1025",
> +		"[12] STRUCT 'unneeded' size=4 vlen=1\n"
> +		"\t'f1' type_id=1 bits_offset=0",
> +		"[13] STRUCT 'embedded' size=4 vlen=1\n"
> +		"\t'f1' type_id=1 bits_offset=0",
> +		"[14] FUNC_PROTO '(anon)' ret_type_id=1 vlen=1\n"
> +		"\t'p1' type_id=1",
> +		"[15] ARRAY '(anon)' type_id=1 index_type_id=1 nr_elems=3");

Sorry, one more thing,
maybe add a a FUNC_PROTO referencing a struct and refer to this proto from btf2?
To check that FUNC_PROTOs are visited as appropriate.

> +
> +	btf2 = btf__new_empty_split(btf1);
> +	if (!ASSERT_OK_PTR(btf2, "empty_split_btf"))
> +		goto cleanup;
> +

[...]





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux