Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'selftests/bpf: BTF-based kernel data display'

Alan Maguire says:

====================
Resolve issues in bpf selftests introduced with BTF-based kernel data
display selftests; these are

- a warning introduced in snprintf_btf.c; and
- compilation failures with old kernels vmlinux.h
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>

+52 -2
+1 -1
tools/testing/selftests/bpf/prog_tests/snprintf_btf.c
··· 27 27 goto cleanup; 28 28 29 29 /* generate receive event */ 30 - system("ping -c 1 127.0.0.1 > /dev/null"); 30 + (void) system("ping -c 1 127.0.0.1 > /dev/null"); 31 31 32 32 if (bss->skip) { 33 33 printf("%s:SKIP:no __builtin_btf_type_id\n", __func__);
+23
tools/testing/selftests/bpf/progs/bpf_iter.h
··· 14 14 #define bpf_iter__bpf_map_elem bpf_iter__bpf_map_elem___not_used 15 15 #define bpf_iter__bpf_sk_storage_map bpf_iter__bpf_sk_storage_map___not_used 16 16 #define bpf_iter__sockmap bpf_iter__sockmap___not_used 17 + #define btf_ptr btf_ptr___not_used 18 + #define BTF_F_COMPACT BTF_F_COMPACT___not_used 19 + #define BTF_F_NONAME BTF_F_NONAME___not_used 20 + #define BTF_F_PTR_RAW BTF_F_PTR_RAW___not_used 21 + #define BTF_F_ZERO BTF_F_ZERO___not_used 17 22 #include "vmlinux.h" 18 23 #undef bpf_iter_meta 19 24 #undef bpf_iter__bpf_map ··· 33 28 #undef bpf_iter__bpf_map_elem 34 29 #undef bpf_iter__bpf_sk_storage_map 35 30 #undef bpf_iter__sockmap 31 + #undef btf_ptr 32 + #undef BTF_F_COMPACT 33 + #undef BTF_F_NONAME 34 + #undef BTF_F_PTR_RAW 35 + #undef BTF_F_ZERO 36 36 37 37 struct bpf_iter_meta { 38 38 struct seq_file *seq; ··· 114 104 struct bpf_map *map; 115 105 void *key; 116 106 struct sock *sk; 107 + }; 108 + 109 + struct btf_ptr { 110 + void *ptr; 111 + __u32 type_id; 112 + __u32 flags; 113 + }; 114 + 115 + enum { 116 + BTF_F_COMPACT = (1ULL << 0), 117 + BTF_F_NONAME = (1ULL << 1), 118 + BTF_F_PTR_RAW = (1ULL << 2), 119 + BTF_F_ZERO = (1ULL << 3), 117 120 };
+27
tools/testing/selftests/bpf/progs/btf_ptr.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* Copyright (c) 2020, Oracle and/or its affiliates. */ 3 + /* "undefine" structs in vmlinux.h, because we "override" them below */ 4 + #define btf_ptr btf_ptr___not_used 5 + #define BTF_F_COMPACT BTF_F_COMPACT___not_used 6 + #define BTF_F_NONAME BTF_F_NONAME___not_used 7 + #define BTF_F_PTR_RAW BTF_F_PTR_RAW___not_used 8 + #define BTF_F_ZERO BTF_F_ZERO___not_used 9 + #include "vmlinux.h" 10 + #undef btf_ptr 11 + #undef BTF_F_COMPACT 12 + #undef BTF_F_NONAME 13 + #undef BTF_F_PTR_RAW 14 + #undef BTF_F_ZERO 15 + 16 + struct btf_ptr { 17 + void *ptr; 18 + __u32 type_id; 19 + __u32 flags; 20 + }; 21 + 22 + enum { 23 + BTF_F_COMPACT = (1ULL << 0), 24 + BTF_F_NONAME = (1ULL << 1), 25 + BTF_F_PTR_RAW = (1ULL << 2), 26 + BTF_F_ZERO = (1ULL << 3), 27 + };
+1 -1
tools/testing/selftests/bpf/progs/netif_receive_skb.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Copyright (c) 2020, Oracle and/or its affiliates. */ 3 3 4 - #include "vmlinux.h" 4 + #include "btf_ptr.h" 5 5 #include <bpf/bpf_helpers.h> 6 6 #include <bpf/bpf_tracing.h> 7 7 #include <bpf/bpf_core_read.h>