Skip to content

ci: Update build.yaml to include Ubuntu 24.04 #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
92d75e5
ci: Update build.yaml to include Ubuntu 24.04
c0d33ngr Jan 15, 2025
3dba43d
ci: Remove deprecated Ubuntu 20.04 from runners
qmonnet Feb 25, 2025
1242a16
mirror: Add probe for libelf-zstd feature
qmonnet Feb 25, 2025
1e210bd
mirror: test
qmonnet Feb 25, 2025
7adc69e
ci: Bump Ubuntu image on runners
qmonnet Feb 25, 2025
88edcb0
mirror: Redefine Makefile's quiet $(Q) in Makefile.include for V=1
qmonnet Apr 3, 2025
1289117
sync: Update libbpf submodule
qmonnet Apr 3, 2025
d230ded
tools: Remove redundant quiet setup
charlie-rivos Feb 13, 2025
a05c2b0
treewide: fix typo 'unsigned __init128' -> 'unsigned __int128'
vincent-mailhol Mar 5, 2025
07aa817
bpf: Add networking timestamping support to bpf_get/setsockopt()
JasonXing Feb 20, 2025
ac5f693
bpf: Add BPF_SOCK_OPS_TSTAMP_SCHED_CB callback
JasonXing Feb 20, 2025
ef4ed37
bpf: Add BPF_SOCK_OPS_TSTAMP_SND_SW_CB callback
JasonXing Feb 20, 2025
60349e6
bpf: Add BPF_SOCK_OPS_TSTAMP_SND_HW_CB callback
JasonXing Feb 20, 2025
6fbc2d1
bpf: Add BPF_SOCK_OPS_TSTAMP_ACK_CB callback
JasonXing Feb 20, 2025
2cdbece
bpf: Add BPF_SOCK_OPS_TSTAMP_SENDMSG_CB callback
JasonXing Feb 20, 2025
3b009e7
bpf: Allow pre-ordering for bpf cgroup progs
Feb 24, 2025
c64dc6a
bpf: Introduce load-acquire and store-release instructions
peilin-ye Mar 4, 2025
d461909
bpf: bpftool: Setting error code in do_loader()
nswon Mar 11, 2025
b3aabd1
bpf: BPF token support for BPF_BTF_GET_FD_BY_ID
mykyta5 Mar 17, 2025
6b435f6
bpftool: Add -Wformat-signedness flag to detect format errors
mrpre Mar 11, 2025
c3e7e7c
bpftool: Using the right format specifiers
mrpre Mar 11, 2025
af82703
sync: Pull latest bpftool changes from kernel
qmonnet Apr 3, 2025
aebfe30
mirror: Update expected diff with kernel sources
qmonnet Apr 3, 2025
e0b761f
sync: Update libbpf submodule
qmonnet May 20, 2025
91b345a
bpf: Fix a comment describing bpf_attr
aspsk Mar 31, 2025
65158f4
bpf: Clarify role of BPF_F_RECOMPUTE_CSUM
pchaigno Apr 8, 2025
f87b1b7
bpf: Clarify the meaning of BPF_F_PSEUDO_HDR
pchaigno Apr 8, 2025
b081076
tools headers: Update the uapi/linux/perf_event.h copy with the kerne…
namhyung Apr 10, 2025
9a01d2e
bpftool: Fix regression of "bpftool cgroup tree" EINVAL on older kernels
zhuyifei1999 Apr 28, 2025
8c79189
bpftool: Fix cgroup command to only show cgroup bpf programs
May 7, 2025
e1625e0
bpf: Add support to retrieve ref_ctr_offset for uprobe perf link
olsajiri May 9, 2025
ed29bec
bpftool: Display ref_ctr_offset for uprobe link info
olsajiri May 9, 2025
dd4ce4e
sync: Pull latest bpftool changes from kernel
qmonnet May 20, 2025
d3e609a
ci: Dump deprecated Ubuntu 20.04 runner
qmonnet May 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
env:
FEATURES: .llvm and .skeletons
Expand All @@ -32,17 +32,13 @@ jobs:
with:
submodules: true

- name: Use clang-12 and not clang-11 for older Ubuntu
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get remove -y clang-11 llvm-11
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 50

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libbfd-dev libcap-dev libelf-dev libiberty-dev python3-docutils
# Install libsframe1 on Ubuntu 24.04+
sudo apt install -y libsframe1 || true
# clang/LLVM are already installed, but we're missing some aliases.
CLANG_VERSION="$(echo '__clang_major__' | clang -E - | tail -n 1)"
sudo update-alternatives \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:
jobs:
build:
name: Build static bpftool binary
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
TARGETARCH: ${{ matrix.arch }}
FILE_STRING_ARCH_amd64: x86-64
Expand All @@ -33,7 +33,7 @@ jobs:
if: matrix.arch == 'amd64'
run: |
sudo apt-get update
sudo apt-get install -y libelf-dev libcap-dev
sudo apt-get install -y libelf-dev libcap-dev libsframe1

- name: Download and extract compiled LLVM release
env:
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:

draft-release:
name: Create a draft release
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
LLVM_URL_PREFIX: https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.0
LLVM_PATH: clang+llvm-15.0.0-x86_64-linux-gnu-rhel-8.4
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libelf-dev
sudo apt-get install -y libelf-dev libsframe1

- name: Download and extract compiled LLVM release
run: |
Expand Down
2 changes: 1 addition & 1 deletion BPF-CHECKPOINT-COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
319fc77f8f45a1b3dba15b0cc1a869778fd222f7
b4432656b36e5cc1d50a1f2dc15357543add530e
2 changes: 1 addition & 1 deletion CHECKPOINT-COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
239860828f8660e2be487e2fbdae2640cce3fd67
9325d53fe9adff354b6a93fda5f38c165947da0f
6 changes: 0 additions & 6 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ INSTALL ?= install
RM ?= rm -f
RMDIR ?= rmdir --ignore-fail-on-non-empty

ifeq ($(V),1)
Q =
else
Q = @
endif

prefix ?= /usr/local
mandir ?= $(prefix)/man
man8dir = $(mandir)/man8
Expand Down
54 changes: 47 additions & 7 deletions include/uapi/linux/bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
#define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
#define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */

#define BPF_LOAD_ACQ 0x100 /* load-acquire */
#define BPF_STORE_REL 0x110 /* store-release */

enum bpf_cond_pseudo_jmp {
BPF_MAY_GOTO = 0,
};
Expand Down Expand Up @@ -1207,6 +1210,7 @@ enum bpf_perf_event_type {
#define BPF_F_BEFORE (1U << 3)
#define BPF_F_AFTER (1U << 4)
#define BPF_F_ID (1U << 5)
#define BPF_F_PREORDER (1U << 6)
#define BPF_F_LINK BPF_F_LINK /* 1 << 13 */

/* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
Expand Down Expand Up @@ -1502,7 +1506,7 @@ union bpf_attr {
__s32 map_token_fd;
};

struct { /* anonymous struct used by BPF_MAP_*_ELEM commands */
struct { /* anonymous struct used by BPF_MAP_*_ELEM and BPF_MAP_FREEZE commands */
__u32 map_fd;
__aligned_u64 key;
union {
Expand Down Expand Up @@ -1648,6 +1652,7 @@ union bpf_attr {
};
__u32 next_id;
__u32 open_flags;
__s32 fd_by_id_token_fd;
};

struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
Expand Down Expand Up @@ -1990,11 +1995,15 @@ union bpf_attr {
* long bpf_skb_store_bytes(struct sk_buff *skb, u32 offset, const void *from, u32 len, u64 flags)
* Description
* Store *len* bytes from address *from* into the packet
* associated to *skb*, at *offset*. *flags* are a combination of
* **BPF_F_RECOMPUTE_CSUM** (automatically recompute the
* checksum for the packet after storing the bytes) and
* **BPF_F_INVALIDATE_HASH** (set *skb*\ **->hash**, *skb*\
* **->swhash** and *skb*\ **->l4hash** to 0).
* associated to *skb*, at *offset*. The *flags* are a combination
* of the following values:
*
* **BPF_F_RECOMPUTE_CSUM**
* Automatically update *skb*\ **->csum** after storing the
* bytes.
* **BPF_F_INVALIDATE_HASH**
* Set *skb*\ **->hash**, *skb*\ **->swhash** and *skb*\
* **->l4hash** to 0.
*
* A call to this helper is susceptible to change the underlying
* packet buffer. Therefore, at load time, all checks on pointers
Expand Down Expand Up @@ -2046,7 +2055,7 @@ union bpf_attr {
* untouched (unless **BPF_F_MARK_ENFORCE** is added as well), and
* for updates resulting in a null checksum the value is set to
* **CSUM_MANGLED_0** instead. Flag **BPF_F_PSEUDO_HDR** indicates
* the checksum is to be computed against a pseudo-header.
* that the modified header field is part of the pseudo-header.
*
* This helper works in combination with **bpf_csum_diff**\ (),
* which does not update the checksum in-place, but offers more
Expand Down Expand Up @@ -6715,6 +6724,7 @@ struct bpf_link_info {
__u32 name_len;
__u32 offset; /* offset from file_name */
__u64 cookie;
__u64 ref_ctr_offset;
} uprobe; /* BPF_PERF_EVENT_UPROBE, BPF_PERF_EVENT_URETPROBE */
struct {
__aligned_u64 func_name; /* in/out */
Expand Down Expand Up @@ -6916,6 +6926,12 @@ enum {
BPF_SOCK_OPS_ALL_CB_FLAGS = 0x7F,
};

enum {
SK_BPF_CB_TX_TIMESTAMPING = 1<<0,
SK_BPF_CB_MASK = (SK_BPF_CB_TX_TIMESTAMPING - 1) |
SK_BPF_CB_TX_TIMESTAMPING
};

/* List of known BPF sock_ops operators.
* New entries can only be added at the end
*/
Expand Down Expand Up @@ -7028,6 +7044,29 @@ enum {
* by the kernel or the
* earlier bpf-progs.
*/
BPF_SOCK_OPS_TSTAMP_SCHED_CB, /* Called when skb is passing
* through dev layer when
* SK_BPF_CB_TX_TIMESTAMPING
* feature is on.
*/
BPF_SOCK_OPS_TSTAMP_SND_SW_CB, /* Called when skb is about to send
* to the nic when SK_BPF_CB_TX_TIMESTAMPING
* feature is on.
*/
BPF_SOCK_OPS_TSTAMP_SND_HW_CB, /* Called in hardware phase when
* SK_BPF_CB_TX_TIMESTAMPING feature
* is on.
*/
BPF_SOCK_OPS_TSTAMP_ACK_CB, /* Called when all the skbs in the
* same sendmsg call are acked
* when SK_BPF_CB_TX_TIMESTAMPING
* feature is on.
*/
BPF_SOCK_OPS_TSTAMP_SENDMSG_CB, /* Called when every sendmsg syscall
* is triggered. It's used to correlate
* sendmsg timestamp with corresponding
* tskey.
*/
};

/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
Expand Down Expand Up @@ -7094,6 +7133,7 @@ enum {
TCP_BPF_SYN_IP = 1006, /* Copy the IP[46] and TCP header */
TCP_BPF_SYN_MAC = 1007, /* Copy the MAC, IP[46], and TCP header */
TCP_BPF_SOCK_OPS_CB_FLAGS = 1008, /* Get or Set TCP sock ops flags */
SK_BPF_CB_FLAGS = 1009, /* Get or set sock ops flags in socket */
};

enum {
Expand Down
2 changes: 1 addition & 1 deletion include/uapi/linux/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Missing asm support
*
* __BIT128() would not work in the asm code, as it shifts an
* 'unsigned __init128' data type as direct representation of
* 'unsigned __int128' data type as direct representation of
* 128 bit constants is not supported in the gcc compiler, as
* they get silently truncated.
*
Expand Down
2 changes: 2 additions & 0 deletions include/uapi/linux/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ enum perf_event_read_format {
*
* @sample_max_stack: Max number of frame pointers in a callchain,
* should be < /proc/sys/kernel/perf_event_max_stack
* Max number of entries of branch stack
* should be < hardware limit
*/
struct perf_event_attr {

Expand Down
21 changes: 8 additions & 13 deletions scripts/sync-kernel-expected-diff.patch
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
libbpf
--- src/Makefile
+++ src/Makefile
@@ -1,10 +1,8 @@
@@ -1,13 +1,11 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-include ../../scripts/Makefile.include
+include Makefile.include
Expand All @@ -32,17 +32,12 @@
-srctree := $(patsubst %/,%,$(dir $(srctree)))
endif

ifeq ($(V),1)
@@ -13,7 +11,7 @@
Q = @
endif

-BPF_DIR = $(srctree)/tools/lib/bpf
+BPF_DIR = $(srctree)/libbpf/src

ifneq ($(OUTPUT),)
_OUTPUT := $(OUTPUT)
@@ -43,16 +41,16 @@
@@ -37,16 +35,16 @@
$(QUIET_MKDIR)mkdir -p $@

$(LIBBPF): $(wildcard $(BPF_DIR)/*.[ch] $(BPF_DIR)/Makefile) | $(LIBBPF_OUTPUT)
Expand All @@ -63,7 +58,7 @@
ARCH= CROSS_COMPILE= CC="$(HOSTCC)" LD="$(HOSTLD)" AR="$(HOSTAR)" $@ install_headers

$(LIBBPF_BOOTSTRAP_INTERNAL_HDRS): $(LIBBPF_BOOTSTRAP_HDRS_DIR)/%.h: $(BPF_DIR)/%.h | $(LIBBPF_BOOTSTRAP_HDRS_DIR)
@@ -76,9 +74,9 @@
@@ -75,9 +73,9 @@
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
-I$(or $(OUTPUT),.) \
-I$(LIBBPF_INCLUDE) \
Expand All @@ -89,7 +84,7 @@
endif

LIBS = $(LIBBPF) -lelf -lz
@@ -214,7 +208,7 @@
@@ -225,7 +219,7 @@
$(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP)
$(QUIET_CLANG)$(CLANG) \
-I$(or $(OUTPUT),.) \
Expand All @@ -98,7 +93,7 @@
-I$(LIBBPF_BOOTSTRAP_INCLUDE) \
-g -O2 -Wall -fno-stack-protector \
--target=bpf -c $< -o $@
@@ -232,7 +226,7 @@
@@ -243,7 +237,7 @@

CFLAGS += $(if $(BUILD_BPF_SKELS),,-DBPFTOOL_WITHOUT_SKELETONS)

Expand All @@ -107,7 +102,7 @@
$(QUIET_CC)$(CC) $(CFLAGS) -c -MMD $< -o $@

$(BPFTOOL_BOOTSTRAP): $(BOOTSTRAP_OBJS) $(LIBBPF_BOOTSTRAP)
@@ -251,7 +245,7 @@
@@ -262,7 +256,7 @@
$(call QUIET_CLEAN, feature-detect)
$(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null

Expand All @@ -116,7 +111,7 @@
$(call QUIET_CLEAN, bpftool)
$(Q)$(RM) -- $(OUTPUT)bpftool $(OUTPUT)*.o $(OUTPUT)*.d
$(Q)$(RM) -- $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
@@ -267,7 +261,7 @@
@@ -278,7 +272,7 @@

install: install-bin
$(Q)$(INSTALL) -m 0755 -d $(DESTDIR)$(bash_compdir)
Expand All @@ -125,7 +120,7 @@

uninstall:
$(call QUIET_UNINST, bpftool)
@@ -275,16 +269,16 @@
@@ -286,16 +280,16 @@
$(Q)$(RM) -- $(DESTDIR)$(bash_compdir)/bpftool

doc:
Expand Down
16 changes: 9 additions & 7 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
endif

ifeq ($(V),1)
Q =
else
Q = @
endif

BPF_DIR = $(srctree)/libbpf/src

ifneq ($(OUTPUT),)
Expand Down Expand Up @@ -69,7 +63,12 @@ prefix ?= /usr/local
bash_compdir ?= /usr/share/bash-completion/completions

CFLAGS += -O2
CFLAGS += -W -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
CFLAGS += -W
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -Wformat-signedness
CFLAGS += -Wno-unused-parameter
CFLAGS += -Wno-missing-field-initializers
CFLAGS += $(filter-out -Wswitch-enum -Wnested-externs,$(EXTRA_WARNINGS))
CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
-I$(or $(OUTPUT),.) \
Expand Down Expand Up @@ -180,6 +179,9 @@ else
ifeq ($(feature-disassembler-init-styled), 1)
CFLAGS += -DDISASM_INIT_STYLED
endif
ifeq ($(feature-libelf-zstd),1)
LIBS += -lsframe
endif
endif
endif
ifeq ($(filter -DHAVE_LLVM_SUPPORT -DHAVE_LIBBFD_SUPPORT,$(CFLAGS)),)
Expand Down
Loading