bpftrace: 0.23.5 -> 0.24.1 (#450486)

This commit is contained in:
dish
2025-10-13 19:22:18 +00:00
committed by GitHub
2 changed files with 22 additions and 5 deletions

View File

@@ -21,7 +21,12 @@
# simple BEGIN probe (user probe on bpftrace itself) # simple BEGIN probe (user probe on bpftrace itself)
print(machine.succeed("bpftrace -e 'BEGIN { print(\"ok\\n\"); exit(); }'")) print(machine.succeed("bpftrace -e 'BEGIN { print(\"ok\\n\"); exit(); }'"))
# tracepoint # tracepoint
print(machine.succeed("bpftrace -e 'tracepoint:syscalls:sys_enter_* { print(probe); exit() }'")) # workaround: this needs more than the default of 1k FD to attach ~350 probes, bump fd limit
# see https://github.com/bpftrace/bpftrace/issues/2110
print(machine.succeed("""
ulimit -n 2048
bpftrace -e 'tracepoint:syscalls:sys_enter_* { print(probe); exit() }'
"""))
# kprobe # kprobe
print(machine.succeed("bpftrace -e 'kprobe:schedule { print(probe); exit() }'")) print(machine.succeed("bpftrace -e 'kprobe:schedule { print(probe); exit() }'"))
# BTF # BTF

View File

@@ -2,6 +2,7 @@
lib, lib,
stdenv, stdenv,
fetchFromGitHub, fetchFromGitHub,
fetchpatch,
llvmPackages, llvmPackages,
elfutils, elfutils,
bcc, bcc,
@@ -16,20 +17,30 @@
flex, flex,
bison, bison,
util-linux, util-linux,
xxd,
nixosTests, nixosTests,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "bpftrace"; pname = "bpftrace";
version = "0.23.5"; version = "0.24.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "bpftrace"; owner = "bpftrace";
repo = "bpftrace"; repo = "bpftrace";
rev = "v${version}"; rev = "v${version}";
hash = "sha256-Shtf4PSXxUV0Bd7ORYyP06lbWf3LE6BQi7WfTIGDOfk="; hash = "sha256-Wt1MXKOg48477HMszq1GAjs+ZELbfAfp+P2AYa+dg+Q=";
}; };
patches = [
(fetchpatch {
name = "attach_tracepoint_with_enums.patch";
url = "https://github.com/bpftrace/bpftrace/pull/4714.patch";
includes = [ "src/ast/passes/clang_parser.cpp" ];
hash = "sha256-xk+/eBNJJJSUqNTs0HFr0BAaqRB5B7CNWRSmnoBMTs0=";
})
];
buildInputs = with llvmPackages; [ buildInputs = with llvmPackages; [
llvm llvm
libclang libclang
@@ -49,11 +60,12 @@ stdenv.mkDerivation rec {
bison bison
llvmPackages.llvm.dev llvmPackages.llvm.dev
util-linux util-linux
xxd
]; ];
cmakeFlags = [ cmakeFlags = [
"-DLIBBCC_INCLUDE_DIRS=${bcc}/include" "-DLIBBCC_INCLUDE_DIRS=${bcc}/include"
"-DINSTALL_TOOL_DOCS=OFF" "-DUSE_SYSTEM_LIBBPF=ON"
"-DSYSTEM_INCLUDE_PATHS=${glibc.dev}/include" "-DSYSTEM_INCLUDE_PATHS=${glibc.dev}/include"
]; ];
@@ -72,7 +84,7 @@ stdenv.mkDerivation rec {
]; ];
passthru.tests = { passthru.tests = {
bpf = nixosTests.bpf; inherit (nixosTests) bpf;
}; };
meta = { meta = {