Skip to content

Commit 8a100e3

Browse files
committed
btf, internal: fix inconsistent external dependencies
It seems like we've checked in external dependencies that are not reproduced when running make update-kernel-deps. Fix this by changing the version number to a patch release and committing the newly generated files. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent 1a5a170 commit 8a100e3

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ testdata/loader-%-eb.elf: testdata/loader.c
118118
$(STRIP) -g $@
119119

120120
.PHONY: update-kernel-deps
121-
update-kernel-deps: export KERNEL_VERSION?=6.8
121+
update-kernel-deps: export KERNEL_VERSION?=6.16.0
122122
update-kernel-deps:
123123
./testdata/sh/update-kernel-deps.sh
124124
$(MAKE) container-all

btf/testdata/btf_testmod.btf

2.99 KB
Binary file not shown.

btf/testdata/vmlinux.btf.gz

55.1 KB
Binary file not shown.

elf_sections.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/sys/types.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,22 @@ const (
5959
BPF_F_INGRESS = 1
6060
BPF_F_INNER_MAP = 4096
6161
BPF_F_INVALIDATE_HASH = 2
62+
BPF_F_IPV6 = 128
6263
BPF_F_KPROBE_MULTI_RETURN = 1
6364
BPF_F_LINK = 8192
6465
BPF_F_LOCK = 4
6566
BPF_F_MARK_ENFORCE = 64
6667
BPF_F_MARK_MANGLED_0 = 32
6768
BPF_F_MMAPABLE = 1024
68-
BPF_F_NEIGH = 2
69-
BPF_F_NEXTHOP = 8
69+
BPF_F_NEIGH = 65536
70+
BPF_F_NEXTHOP = 262144
7071
BPF_F_NO_COMMON_LRU = 2
7172
BPF_F_NO_PREALLOC = 1
7273
BPF_F_NO_TUNNEL_KEY = 16
7374
BPF_F_NO_USER_CONV = 262144
7475
BPF_F_NUMA_NODE = 4
7576
BPF_F_PATH_FD = 16384
76-
BPF_F_PEER = 4
77+
BPF_F_PEER = 131072
7778
BPF_F_PRESERVE_ELEMS = 2048
7879
BPF_F_PSEUDO_HDR = 16
7980
BPF_F_RDONLY = 8
@@ -101,6 +102,7 @@ const (
101102
BPF_LOAD_HDR_OPT_TCP_SYN = 1
102103
BPF_LOCAL_STORAGE_GET_F_CREATE = 1
103104
BPF_MAX_LOOPS = 8388608
105+
BPF_MAX_TIMED_LOOPS = 65535
104106
BPF_MAX_TRAMP_LINKS = 38
105107
BPF_NOEXIST = 1
106108
BPF_RB_AVAIL_DATA = 0
@@ -152,6 +154,11 @@ const (
152154
BPF_SOCK_OPS_TCP_CONNECT_CB = 3
153155
BPF_SOCK_OPS_TCP_LISTEN_CB = 11
154156
BPF_SOCK_OPS_TIMEOUT_INIT = 1
157+
BPF_SOCK_OPS_TSTAMP_ACK_CB = 19
158+
BPF_SOCK_OPS_TSTAMP_SCHED_CB = 16
159+
BPF_SOCK_OPS_TSTAMP_SENDMSG_CB = 20
160+
BPF_SOCK_OPS_TSTAMP_SND_HW_CB = 18
161+
BPF_SOCK_OPS_TSTAMP_SND_SW_CB = 17
155162
BPF_SOCK_OPS_VOID = 0
156163
BPF_SOCK_OPS_WRITE_HDR_OPT_CB = 15
157164
BPF_SOCK_OPS_WRITE_HDR_OPT_CB_FLAG = 64
@@ -244,7 +251,8 @@ const (
244251
BPF_NETKIT_PRIMARY AttachType = 54
245252
BPF_NETKIT_PEER AttachType = 55
246253
BPF_TRACE_KPROBE_SESSION AttachType = 56
247-
__MAX_BPF_ATTACH_TYPE AttachType = 57
254+
BPF_TRACE_UPROBE_SESSION AttachType = 57
255+
__MAX_BPF_ATTACH_TYPE AttachType = 58
248256
)
249257

250258
type Cmd uint32
@@ -1450,7 +1458,7 @@ type ProgLoadAttr struct {
14501458
CoreReloRecSize uint32
14511459
LogTrueSize uint32
14521460
ProgTokenFd int32
1453-
_ [4]byte
1461+
FdArrayCnt uint32
14541462
}
14551463

14561464
func ProgLoad(attr *ProgLoadAttr) (*FD, error) {

testdata/sh/update-kernel-deps.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ cleanup() {
3131
trap cleanup EXIT
3232

3333
# Download and process libbpf.c
34-
curl -fL "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/tools/lib/bpf/libbpf.c?h=v$KERNEL_VERSION" -o "$tmp/libbpf.c"
34+
# Truncate .0 patch versions (e.g., 6.16.0 -> 6.16, but leave 7.0 as 7.0)
35+
kernel_version_for_url="$KERNEL_VERSION"
36+
if [[ $KERNEL_VERSION =~ ^([0-9]+\.[0-9]+)\.0$ ]]; then
37+
kernel_version_for_url="${BASH_REMATCH[1]}"
38+
fi
39+
curl -fL "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/tools/lib/bpf/libbpf.c?h=v$kernel_version_for_url" -o "$tmp/libbpf.c"
3540
"./internal/cmd/gensections.awk" "$tmp/libbpf.c" | gofmt > "./elf_sections.go"
3641

3742
# Download and process vmlinux and btf_testmod

0 commit comments

Comments
 (0)