Skip to content

Commit 3df3bd6

Browse files
yonghong-songAlexei Starovoitov
authored andcommitted
selftests/bpf: Change NAME_NTH/IS_NAME_NTH for BTF_KIND_TAG format
BTF_KIND_TAG ELF format has a component_idx which might have value -1. test_btf may confuse it with common_type.name as NAME_NTH checkes high 16bit to be 0xffff. Change NAME_NTH high 16bit check to be 0xfffe so it won't confuse with component_idx. Signed-off-by: Yonghong Song <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 71d29c2 commit 3df3bd6

File tree

1 file changed

+2
-2
lines changed
  • tools/testing/selftests/bpf/prog_tests

1 file changed

+2
-2
lines changed

tools/testing/selftests/bpf/prog_tests/btf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ static bool always_log;
3939
#define BTF_END_RAW 0xdeadbeef
4040
#define NAME_TBD 0xdeadb33f
4141

42-
#define NAME_NTH(N) (0xffff0000 | N)
43-
#define IS_NAME_NTH(X) ((X & 0xffff0000) == 0xffff0000)
42+
#define NAME_NTH(N) (0xfffe0000 | N)
43+
#define IS_NAME_NTH(X) ((X & 0xffff0000) == 0xfffe0000)
4444
#define GET_NAME_NTH_IDX(X) (X & 0x0000ffff)
4545

4646
#define MAX_NR_RAW_U32 1024

0 commit comments

Comments
 (0)