-
Notifications
You must be signed in to change notification settings - Fork 4k
bpftune: add new package #30446
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
base: master
Are you sure you want to change the base?
bpftune: add new package #30446
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,157 @@ | ||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||
| # This is free software, licensed under the GNU General Public License v2. | ||||||||||||||||||||||||||||||||||||||
| # See /LICENSE for more information. | ||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| include $(TOPDIR)/rules.mk | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| PKG_NAME:=bpftune | ||||||||||||||||||||||||||||||||||||||
| PKG_VERSION:=0.4.2-f562f77 | ||||||||||||||||||||||||||||||||||||||
| PKG_RELEASE:=1 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| PKG_SOURCE_PROTO:=git | ||||||||||||||||||||||||||||||||||||||
| PKG_SOURCE_URL:=https://github.com/KyleGospo/bpftune.git | ||||||||||||||||||||||||||||||||||||||
| PKG_SOURCE_DATE:=2026-08-26 | ||||||||||||||||||||||||||||||||||||||
| PKG_SOURCE_VERSION:=f562f776aac16478a2eeae1bf4871a66dd0070c3 | ||||||||||||||||||||||||||||||||||||||
| PKG_MIRROR_HASH:=fb49aaad19ee711226b8bf62ded281e7346750c4e4d08909b2a37ac58765438c | ||||||||||||||||||||||||||||||||||||||
| PKG_BUILD_DIR:=$(BUILD_DIR)/$(if $(BUILD_VARIANT),bpftune-$(BUILD_VARIANT)/)bpftune-$(PKG_VERSION) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| PKG_LICENSE:=GPL-2.0-WITH-Linux-syscall-note | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this changed from Generated by Claude Code |
||||||||||||||||||||||||||||||||||||||
| PKG_LICENSE_FILES:=COPYING | ||||||||||||||||||||||||||||||||||||||
| PKG_MAINTAINER:=Shon Sebastian <fluffball3@proton.me> | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| PKG_BUILD_DEPENDS:=bpf-headers | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| include $(INCLUDE_DIR)/package.mk | ||||||||||||||||||||||||||||||||||||||
| include $(INCLUDE_DIR)/bpf.mk | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune/default | ||||||||||||||||||||||||||||||||||||||
| SECTION:=net | ||||||||||||||||||||||||||||||||||||||
| CATEGORY:=Network | ||||||||||||||||||||||||||||||||||||||
| DEPENDS:=+@KERNEL_BPF_EVENTS +@KERNEL_CGROUPS +@KERNEL_CGROUP_BPF \ | ||||||||||||||||||||||||||||||||||||||
| +kmod-tcp-bbr +libnl-route +libcap +libbpf \ | ||||||||||||||||||||||||||||||||||||||
| $(BPF_DEPENDS) | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(call Package/bpftune/default) | ||||||||||||||||||||||||||||||||||||||
| URL:=https://github.com/oracle/bpftune | ||||||||||||||||||||||||||||||||||||||
| TITLE:=BPF driven auto-tuning (needs TCP_CONG_HTCP and TCP_CONG_DCTCP) | ||||||||||||||||||||||||||||||||||||||
| CONFLICTS:=bpftune-gaming bpftune-gaming-full | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-full | ||||||||||||||||||||||||||||||||||||||
| $(call Package/bpftune/default) | ||||||||||||||||||||||||||||||||||||||
| URL:=https://github.com/oracle/bpftune | ||||||||||||||||||||||||||||||||||||||
| TITLE:=bpftune with BTF support (might cause crashloops on limited hardware). | ||||||||||||||||||||||||||||||||||||||
| DEPENDS:=+bpftune +@KERNEL_DEBUG_INFO +@KERNEL_DEBUG_INFO_BTF \ | ||||||||||||||||||||||||||||||||||||||
| +@KERNEL_NAMESPACES +@KERNEL_NET_NS | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-gaming | ||||||||||||||||||||||||||||||||||||||
| $(call Package/bpftune/default) | ||||||||||||||||||||||||||||||||||||||
| URL:=https://github.com/KyleGospo/bpftune | ||||||||||||||||||||||||||||||||||||||
| TITLE:=Fork of bpftune with gaming tuner without BTF support (needs TCP_CONG_HTCP and TCP_CONG_DCTCP) | ||||||||||||||||||||||||||||||||||||||
| VARIANT:=gaming | ||||||||||||||||||||||||||||||||||||||
| CONFLICTS:=bpftune bpftune-full | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+51
to
+57
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by Claude Code |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-gaming-full | ||||||||||||||||||||||||||||||||||||||
| $(call Package/bpftune/default) | ||||||||||||||||||||||||||||||||||||||
| URL:=https://github.com/KyleGospo/bpftune | ||||||||||||||||||||||||||||||||||||||
| TITLE:=bpftune-gaming with BTF support (might cause crashloops on limited hardware) | ||||||||||||||||||||||||||||||||||||||
| DEPENDS:=+bpftune-gaming +@KERNEL_DEBUG_INFO +@KERNEL_DEBUG_INFO_BTF \ | ||||||||||||||||||||||||||||||||||||||
| +@KERNEL_NAMESPACES +@KERNEL_NET_NS | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune/description | ||||||||||||||||||||||||||||||||||||||
| bpftune aims to provide lightweight, always-on auto-tuning of system | ||||||||||||||||||||||||||||||||||||||
| behaviour. By using BPF observability features, we can continuously | ||||||||||||||||||||||||||||||||||||||
| monitor and adjust system behaviour at a fine grain. (Needs TCP_CONG_HTCP | ||||||||||||||||||||||||||||||||||||||
| and TCP_CONG_DCTCP from target/linux/generic/config-<version> manually enabled | ||||||||||||||||||||||||||||||||||||||
| to function correctly. Runs on no-BTF mode). | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-full/description | ||||||||||||||||||||||||||||||||||||||
| bpftune with BTF support for intended functionality. Needs TCP_CONG_HTCP | ||||||||||||||||||||||||||||||||||||||
| and TCP_CONG_DCTCP from target/linux/generic/config-<version> manually enabled | ||||||||||||||||||||||||||||||||||||||
| to function, and KERNEL_DEBUG_INFO_REDUCED disabled manually. This package enables | ||||||||||||||||||||||||||||||||||||||
| KERNEL_NET_NS and KERNEL_DEBUG_INFO_BTF as well which might cause crashloops on | ||||||||||||||||||||||||||||||||||||||
| limited hardware eg. single core cpu routers. | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-gaming/description | ||||||||||||||||||||||||||||||||||||||
| Fork of bpftune which adds separate tuner and changes for gaming. (Needs | ||||||||||||||||||||||||||||||||||||||
| TCP_CONG_HTCP and TCP_CONG_DCTCP from target/linux/generic/config-<version> | ||||||||||||||||||||||||||||||||||||||
| manually enabled to function correctly. Runs on no-BTF mode). | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-gaming-full/description | ||||||||||||||||||||||||||||||||||||||
| bpftune-gaming with BTF support for intended functionality. Needs TCP_CONG_HTCP | ||||||||||||||||||||||||||||||||||||||
| and TCP_CONG_DCTCP from target/linux/generic/config-<version> manually enabled | ||||||||||||||||||||||||||||||||||||||
| to function, and KERNEL_DEBUG_INFO_REDUCED disabled manually. This package enables | ||||||||||||||||||||||||||||||||||||||
| KERNEL_NET_NS and KERNEL_DEBUG_INFO_BTF as well which might cause crashloops on | ||||||||||||||||||||||||||||||||||||||
| limited hardware eg. single core cpu routers. | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| bpf_srcarch=$(subst \ | ||||||||||||||||||||||||||||||||||||||
| aarch64,arm64,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| armeb,arm,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| i386,x86,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| x86_64,x86,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| loongarch64,loongarch,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| mipsel,mips,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| mips64,mips,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| powerpc64,powerpc,$(subst \ | ||||||||||||||||||||||||||||||||||||||
| riscv64,riscv,$(1)))))))))) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| BPF_SRCARCH:=$(call bpf_srcarch,$(ARCH)) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| MAKE_FLAGS += \ | ||||||||||||||||||||||||||||||||||||||
| BPFTUNE_VERSION="$(PKG_VERSION)-$(PKG_RELEASE)" \ | ||||||||||||||||||||||||||||||||||||||
| SRCARCH="$(BPF_SRCARCH)" \ | ||||||||||||||||||||||||||||||||||||||
| BPF_TARGET="$(BPF_TARGET)" \ | ||||||||||||||||||||||||||||||||||||||
| BPF_CLANG="$(CLANG)" \ | ||||||||||||||||||||||||||||||||||||||
| LLVM_STRIP="$(LLVM_STRIP)" \ | ||||||||||||||||||||||||||||||||||||||
| PKG_BUILD_DIR=$(PKG_BUILD_DIR) \ | ||||||||||||||||||||||||||||||||||||||
| GAMING_BUILD=$(if $(filter gaming,$(BUILD_VARIANT)),true) | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune/conffiles | ||||||||||||||||||||||||||||||||||||||
| /etc/config/bpftune | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+119
to
+121
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Generated by Claude Code
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-gaming/conffiles | ||||||||||||||||||||||||||||||||||||||
| /etc/config/bpftune | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune/install | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/usr/sbin | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bpftune $(1)/usr/sbin/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/usr/lib | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libbpftune.so.0.4.2 $(1)/usr/lib/libbpftune.so.0.4.2 | ||||||||||||||||||||||||||||||||||||||
| $(LN) libbpftune.so.0.4.2 $(1)/usr/lib/libbpftune.so | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tcp_buffer_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/route_table_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/neigh_table_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sysctl_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tcp_conn_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/netns_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/net_buffer_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ip_frag_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/udp_buffer_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/etc | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/etc/config | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DIR) $(1)/etc/init.d | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DATA) ./files/bpftune.confd $(1)/etc/config/bpftune | ||||||||||||||||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With Generated by Claude Code
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) ./files/bpftune.initd $(1)/etc/init.d/bpftune | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| define Package/bpftune-gaming/install | ||||||||||||||||||||||||||||||||||||||
| $(call Package/bpftune/install) | ||||||||||||||||||||||||||||||||||||||
| $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/gaming_tuner.so $(1)/usr/lib/bpftune | ||||||||||||||||||||||||||||||||||||||
| endef | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| $(eval $(call BuildPackage,bpftune)) | ||||||||||||||||||||||||||||||||||||||
| $(eval $(call BuildPackage,bpftune-full)) | ||||||||||||||||||||||||||||||||||||||
| $(eval $(call BuildPackage,bpftune-gaming)) | ||||||||||||||||||||||||||||||||||||||
| $(eval $(call BuildPackage,bpftune-gaming-full)) | ||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| config defaults 'defaults' | ||
| option command_args "-R -c /sys/fs/cgroup" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/bin/sh /etc/rc.common | ||
| # SPDX-License-Identifier: GPL-2.0-or-later | ||
|
|
||
| USE_PROCD=1 | ||
|
|
||
| START=81 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: the PR description says the service is disabled by default, but Generated by Claude Code
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| STOP=81 | ||
|
|
||
| NAME=bpftune | ||
| PROG=/usr/sbin/bpftune | ||
| CONFIG=/etc/config/bpftune | ||
|
|
||
| ARGS="-R -c /sys/fs/cgroup" | ||
| EXTRA_COMMANDS="checkconf" | ||
|
|
||
| checkconf() { | ||
| config_load 'bpftune' | ||
| config_get ARGS defaults command_args "$ARGS" | ||
| $PROG -S $ARGS 2>&1 | ||
| } | ||
|
|
||
| start_pre() { | ||
| checkconf > /dev/null 2>&1 | ||
| } | ||
|
|
||
| start_service() | ||
| { | ||
| if ! start_pre; then | ||
| return 1 | ||
| fi | ||
|
|
||
| procd_open_instance | ||
| procd_set_param file $CONFIG | ||
| procd_set_param command $PROG $ARGS | ||
| procd_set_param respawn | ||
| procd_close_instance | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patches in this feed carry a numeric prefix that pins apply order ( Generated by Claude Code
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK I'll look into it. Thanks for the advice. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| From ef5d2d5e44dfc4e38e53da92843731b6317aa32d Mon Sep 17 00:00:00 2001 | ||
| From: Shon Sebastian <fluffball3@proton.me> | ||
| Date: Tue, 22 Sep 2026 03:25:50 +0530 | ||
| Subject: [PATCH] build src only | ||
|
|
||
| Simplify build | ||
|
|
||
| Signed-off-by: Shon Sebastian <fluffball3@proton.me> | ||
| --- | ||
| Makefile | 2 +- | ||
| 1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
|
||
| diff --git a/Makefile b/Makefile | ||
| index 5e93dc0..c23a5f0 100644 | ||
| --- a/Makefile | ||
| +++ b/Makefile | ||
| @@ -33,7 +33,7 @@ INSTALLPATH = $(installprefix) | ||
|
|
||
| .PHONY: all clean | ||
|
|
||
| -all: srcdir docdir testdir | ||
| +all: srcdir | ||
|
|
||
| srcdir: | ||
| cd src; make | ||
| -- | ||
| 2.55.0 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| From cb358f17dd1c6b7154f36fe94d2dc5479d6e95c6 Mon Sep 17 00:00:00 2001 | ||
| From: Shon Sebastian <fluffball3@proton.me> | ||
| Date: Tue, 22 Sep 2026 03:23:21 +0530 | ||
| Subject: [PATCH] fix Makefile | ||
|
|
||
| Adapts build for openwrt | ||
|
|
||
| Signed-off-by: Shon Sebastian <fluffball3@proton.me> | ||
| --- | ||
| src/Makefile | 53 ++++++++++++++++++++++++++++------------------------ | ||
| 1 file changed, 29 insertions(+), 24 deletions(-) | ||
|
|
||
| diff --git a/src/Makefile b/src/Makefile | ||
| index 85a6d55..cb80c11 100644 | ||
| --- a/src/Makefile | ||
| +++ b/src/Makefile | ||
| @@ -15,21 +15,17 @@ | ||
| # License along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| # | ||
|
|
||
| -ARCH ?= $(shell uname -m) | ||
| -SRCARCH ?= $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ | ||
| - -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \ | ||
| - -e s/aarch64.*/arm64/ ) | ||
| - | ||
| CLANG ?= clang | ||
| GCC_BPF ?= | ||
| LLC ?= llc | ||
| LLVM_STRIP ?= llvm-strip | ||
| BPFTOOL ?= bpftool | ||
| -BPF_INCLUDE := /usr/include | ||
| -BPF_LOCAL_INCLUDE := /usr/local/include | ||
| -BPF_CFLAGS := -g -fno-stack-protector -Wall -Wno-incompatible-pointer-types-discards-qualifiers | ||
| -NL_INCLUDE := /usr/include/libnl3 | ||
| -INCLUDES := -I../include -I$(BPF_INCLUDE) -I$(BPF_LOCAL_INCLUDE) -I$(NL_INCLUDE) -I../include/uapi | ||
| +BPF_CFLAGS += -g -fno-stack-protector -Wall -Wno-incompatible-pointer-types-discards-qualifiers | ||
| + | ||
| +INCLUDES := -I../include \ | ||
| + -I$(STAGING_DIR)/usr/include \ | ||
| + -I$(STAGING_DIR)/usr/include/libnl3 | ||
| + | ||
| INSTALL ?= install | ||
|
|
||
| SBINPATH ?= $(shell rpm --eval '%{_sbindir}' 2>/dev/null) | ||
| @@ -52,7 +48,7 @@ else | ||
| DEFAULT_LIBDIR := lib64 | ||
| endif | ||
|
|
||
| -libdir ?= $(DEFAULT_LIBDIR) | ||
| +libdir = lib | ||
| installprefix = $(DESTDIR)/$(prefix) | ||
|
|
||
| INSTALLPATH = $(installprefix) | ||
| @@ -75,7 +71,7 @@ endif | ||
| VERSION = 0.4.2 | ||
| VERSION_SCRIPT := libbpftune.map | ||
|
|
||
| -CFLAGS = -fPIC -Wall -Wextra -g -I../include -std=c99 | ||
| +CFLAGS += -fPIC -Wall -Wextra -g -std=c99 | ||
|
|
||
| CFLAGS += -DBPFTUNE_VERSION='"$(BPFTUNE_VERSION)"' \ | ||
| -DBPFTUNER_PREFIX_DIR='"$(prefix)"' \ | ||
| @@ -92,12 +88,12 @@ VMLINUX_BTF_PATHS := /sys/kernel/btf/vmlinux /boot/vmlinux-$(KERNEL_REL) | ||
| VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \ | ||
| $(wildcard $(VMLINUX_BTF_PATHS)))) | ||
|
|
||
| -# Some systems ship with a vmlinux.h; use it. | ||
| -VMLINUX_H_PATH ?= /usr/include/$(ARCH)-linux-gnu/linux/bpf/ | ||
| -VMLINUX_H_FILE := $(wildcard $(VMLINUX_H_PATH)/vmlinux.h) | ||
| +# Try to reach generated vmlinux.h if it exists | ||
| +VMLINUX_H_FILE := $(wildcard $(PKG_BUILD_DIR)/vmlinux.h) | ||
|
|
||
| +# Defaults to ../include/bpftune/vmlinux_aarch64.h as the best available fallback. | ||
| ifneq ($(VMLINUX_H_FILE),) | ||
| -BPF_CFLAGS += -DVMLINUX_H -I$(VMLINUX_H_PATH) | ||
| +BPF_CFLAGS += -DVMLINUX_H -I$(PKG_BUILD_DIR) | ||
| endif | ||
|
|
||
| OPATH := | ||
| @@ -114,9 +110,15 @@ MAKEFLAGS += --no-print-directory | ||
| submake_extras := feature_display=0 | ||
| endif | ||
|
|
||
| +ifneq ($(GAMING_BUILD),) | ||
| TUNERS = tcp_buffer_tuner route_table_tuner neigh_table_tuner sysctl_tuner \ | ||
| tcp_conn_tuner netns_tuner net_buffer_tuner ip_frag_tuner \ | ||
| udp_buffer_tuner gaming_tuner | ||
| +else | ||
| +TUNERS = tcp_buffer_tuner route_table_tuner neigh_table_tuner sysctl_tuner \ | ||
| + tcp_conn_tuner netns_tuner net_buffer_tuner ip_frag_tuner \ | ||
| + udp_buffer_tuner | ||
| +endif | ||
|
|
||
| TUNER_OBJS = $(patsubst %,%.o,$(TUNERS)) | ||
| TUNER_SRCS = $(patsubst %,%.c,$(TUNERS)) | ||
| @@ -209,18 +211,21 @@ $(OPATH)bpftune.o: $(OPATH)libbpftune.so | ||
| # check if GCC_BPF flag is set, otherwise use CLANG | ||
| ifeq ($(GCC_BPF),) | ||
| $(BPF_OBJS): $(patsubst %.o,%.c,$(BPF_OBJS)) ../include/bpftune/bpftune.bpf.h | ||
| - $(CLANG) $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) -O2 -target bpf \ | ||
| - $(INCLUDES) -c $(patsubst %.o,%.c,$(@)) -o $(@) | ||
| + $(BPF_CLANG) $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) -O2 -target $(BPF_TARGET) \ | ||
| + -I../include -c $(patsubst %.o,%.c,$(@)) -o $(@) | ||
| + $(LLVM_STRIP) --strip-debug $(@) | ||
|
|
||
| $(LEGACY_BPF_OBJS): $(patsubst %.legacy.o,%.c,$(LEGACY_BPF_OBJS)) ../include/bpftune/bpftune.bpf.h | ||
| - $(CLANG) $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) -DBPFTUNE_LEGACY -O2 -target bpf \ | ||
| - $(INCLUDES) -c $(patsubst %.legacy.o,%.c,$(@)) \ | ||
| - -o $(@) | ||
| + $(BPF_CLANG) $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) -DBPFTUNE_LEGACY -O2 -target $(BPF_TARGET) \ | ||
| + -I../include -c $(patsubst %.legacy.o,%.c,$(@)) \ | ||
| + -o $(@) | ||
| + $(LLVM_STRIP) --strip-debug $(@) | ||
|
|
||
| $(NOBTF_BPF_OBJS): $(patsubst %.nobtf.o,%.c,$(NOBTF_BPF_OBJS)) ../include/bpftune/bpftune.bpf.h | ||
| - $(CLANG) $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) -DBPFTUNE_NOBTF -O2 -target bpf \ | ||
| - $(INCLUDES) -c $(patsubst %.nobtf.o,%.c,$(@)) \ | ||
| - -o $(@) | ||
| + $(BPF_CLANG) $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) -DBPFTUNE_NOBTF -O2 -target $(BPF_TARGET) \ | ||
| + -I../include -c $(patsubst %.nobtf.o,%.c,$(@)) \ | ||
| + -o $(@) | ||
| + $(LLVM_STRIP) --strip-debug $(@) | ||
| else | ||
| GCC_BPF_FLAGS := -g -O2 \ | ||
| $(BPF_CFLAGS) -D__TARGET_ARCH_$(SRCARCH) \ | ||
| -- | ||
| 2.55.0 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: two things about the move to the fork's git tree:
PKG_SOURCE_PROTO:=gitis a last resort in this feed when a release tarball exists; the previous revision fetched a codeload tarball, and that form works against a fork commit too.bpftuneandbpftune-fullare now built from this fork as well, yet still advertiseURL:=https://github.com/oracle/bpftuneon lines 38 and 44. Is the non-gaming build meant to track oracle instead?Generated by Claude Code