Rebase to v0.26.0

Rebuild with LLVM 22

Resolves: RHEL-170957
Resolves: RHEL-162984

Signed-off-by: Gregory Bell <grbell@redhat.com>
This commit is contained in:
Gregory Bell 2026-05-27 16:20:31 -04:00
parent 52a560428f
commit 7cdf559df8
6 changed files with 121 additions and 114 deletions

2
.gitignore vendored
View File

@ -21,3 +21,5 @@
/bpftrace-0.23.5.tar.gz
/bpftrace-0.24.1.tar.gz
/bpftrace-0.24.2.tar.gz
/bpftrace-0.26.0.tar.gz
/bpftrace-0.26.1.tar.gz

View File

@ -1,97 +0,0 @@
From b5e6a5f7fbcdf49fd19aafd519e04978f04a5aa7 Mon Sep 17 00:00:00 2001
From: Viktor Malik <viktor.malik@gmail.com>
Date: Fri, 6 Jun 2025 07:54:19 +0200
Subject: [PATCH] runqlen.bt: Use old version of the tool
RHEL 9 doesn't have 736c55a02c47 ("sched/fair: Rename cfs_rq.nr_running
into nr_queued") so we need to use the old name of the struct fields.
Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
---
tools/old/runqlen.bt | 40 ----------------------------------------
tools/runqlen.bt | 8 +++++---
2 files changed, 5 insertions(+), 43 deletions(-)
delete mode 100755 tools/old/runqlen.bt
diff --git a/tools/old/runqlen.bt b/tools/old/runqlen.bt
deleted file mode 100755
index 82627c7d..00000000
--- a/tools/old/runqlen.bt
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env bpftrace
-/*
- * runqlen.bt CPU scheduler run queue length as a histogram.
- * For Linux, uses bpftrace, eBPF.
- *
- * This is a bpftrace version of the bcc tool of the same name.
- *
- * For Linux < 6.14.
- *
- * Copyright 2018 Netflix, Inc.
- *
- * 07-Oct-2018 Brendan Gregg Created this.
- */
-
-#ifndef BPFTRACE_HAVE_BTF
-#include <linux/sched.h>
-
-// Without BTF, we'll need to declare some of this struct manually,
-// since it isn't available to be #included. This will need maintenance to match
-// your kernel version. It is from kernel/sched/sched.h:
-struct cfs_rq {
- struct load_weight load;
- unsigned int nr_running;
- unsigned int h_nr_running;
-};
-#endif
-
-BEGIN
-{
- printf("Sampling run queue length at 99 Hertz... Hit Ctrl-C to end.\n");
-}
-
-profile:hz:99
-{
- $task = (struct task_struct *)curtask;
- $my_q = (struct cfs_rq *)$task->se.cfs_rq;
- $len = (uint64)$my_q->nr_running;
- $len = $len > 0 ? $len - 1 : 0; // subtract currently running task
- @runqlen = lhist($len, 0, 100, 1);
-}
diff --git a/tools/runqlen.bt b/tools/runqlen.bt
index fb206d3c..a9fac9e1 100755
--- a/tools/runqlen.bt
+++ b/tools/runqlen.bt
@@ -23,6 +23,8 @@
* This is a bpftrace version of the bcc tool of the same name.
* The bcc version provides options to customize the output.
*
+ * For Linux < 6.14.
+ *
* Copyright 2018 Netflix, Inc.
*
* 07-Oct-2018 Brendan Gregg Created this.
@@ -36,8 +38,8 @@
// your kernel version. It is from kernel/sched/sched.h:
struct cfs_rq {
struct load_weight load;
- unsigned int nr_queued;
- unsigned int h_nr_queued;
+ unsigned int nr_running;
+ unsigned int h_nr_running;
};
#endif
@@ -50,7 +52,7 @@ profile:hz:99
{
$task = (struct task_struct *)curtask;
$my_q = (struct cfs_rq *)$task->se.cfs_rq;
- $len = (uint64)$my_q->nr_queued;
+ $len = (uint64)$my_q->nr_running;
$len = $len > 0 ? $len - 1 : 0; // subtract currently running task
@runqlen = lhist($len, 0, 100, 1);
}
--
2.50.1

View File

@ -1,6 +1,6 @@
From b36872e810f4f71280ef11c0cdf58344a473e706 Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 11 Jun 2020 14:56:36 +0200
From f9ca7f48ae44ac078158b732e2328873f126d325 Mon Sep 17 00:00:00 2001
From: Gregory Bell <grbell@redhat.com>
Date: Wed, 27 May 2026 15:45:08 -0400
Subject: [PATCH] RHEL: aarch64: fixes statsnoop and opensnoop
On aarch64 the open syscall has been dropped. Only openat and openat2
@ -21,18 +21,19 @@ Signed-off-by: Viktor Malik <vmalik@redhat.com>
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/tools/opensnoop.bt b/tools/opensnoop.bt
index aafacd10..1e51197e 100755
index b0cfc647..3faf202c 100644
--- a/tools/opensnoop.bt
+++ b/tools/opensnoop.bt
@@ -49,14 +49,12 @@ BEGIN
printf("%-6s %-16s %4s %3s %s\n", "PID", "COMM", "FD", "ERR", "PATH");
@@ -62,7 +62,6 @@ BEGIN
printf(" %s\n", "PATH");
}
-tracepoint:syscalls:sys_enter_open,
tracepoint:syscalls:sys_enter_openat,
tracepoint:syscalls:sys_enter_openat2
{
@filename[tid] = args.filename;
@@ -145,7 +144,6 @@ macro sys_exit(ret, @filename, @paths)
delete(@filename, tid);
}
-tracepoint:syscalls:sys_exit_open,
@ -40,11 +41,11 @@ index aafacd10..1e51197e 100755
tracepoint:syscalls:sys_exit_openat2
/@filename[tid]/
diff --git a/tools/statsnoop.bt b/tools/statsnoop.bt
index ebab9744..48367151 100755
index 8499cf70..d53f0b19 100644
--- a/tools/statsnoop.bt
+++ b/tools/statsnoop.bt
@@ -77,17 +77,13 @@ tracepoint:syscalls:sys_enter_statfs
@filename[tid] = args.pathname;
@@ -79,17 +79,13 @@ tracepoint:syscalls:sys_enter_statfs
@filename[tid] = args.pathname;
}
-tracepoint:syscalls:sys_enter_statx,
@ -52,7 +53,7 @@ index ebab9744..48367151 100755
-tracepoint:syscalls:sys_enter_newlstat
+tracepoint:syscalls:sys_enter_statx
{
@filename[tid] = args.filename;
@filename[tid] = args.filename;
}
tracepoint:syscalls:sys_exit_statfs,
@ -62,7 +63,7 @@ index ebab9744..48367151 100755
+tracepoint:syscalls:sys_exit_statx
/@filename[tid]/
{
$ret = args.ret;
$ret = args.ret;
--
2.50.1
2.52.0

View File

@ -0,0 +1,96 @@
From 9f2a4f0afe2b9047097703acf1f2fc03f046fa15 Mon Sep 17 00:00:00 2001
From: Gregory Bell <grbell@redhat.com>
Date: Wed, 27 May 2026 15:09:43 -0400
Subject: [PATCH] runqlen.bt: Use old version of the tool
RHEL 9 doesn't have 736c55a02c47 ("sched/fair: Rename cfs_rq.nr_running
into nr_queued") so we need to use the old name of the struct fields.
Signed-off-by: Viktor Malik <viktor.malik@gmail.com>
---
tools/old/runqlen.bt | 39 ---------------------------------------
tools/runqlen.bt | 8 +++++---
2 files changed, 5 insertions(+), 42 deletions(-)
delete mode 100644 tools/old/runqlen.bt
diff --git a/tools/old/runqlen.bt b/tools/old/runqlen.bt
deleted file mode 100644
index 1d42b623..00000000
--- a/tools/old/runqlen.bt
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env bpftrace
-// runqlen.bt CPU scheduler run queue length as a histogram.
-// For Linux, uses bpftrace, eBPF.
-//
-// This is a bpftrace version of the bcc tool of the same name.
-//
-// For Linux < 6.14.
-//
-// Copyright 2018 Netflix, Inc.
-//
-// 07-Oct-2018 Brendan Gregg Created this.
-
-#ifndef BPFTRACE_HAVE_BTF
-#include <linux/sched.h>
-
-// Without BTF, we'll need to declare some of this struct manually,
-// since it isn't available to be #included. This will need maintenance to match
-// your kernel version. It is from kernel/sched/sched.h:
-struct cfs_rq {
- struct load_weight load;
- unsigned int nr_running;
- unsigned int h_nr_running;
-};
-#endif
-
-BEGIN
-{
- printf("Sampling run queue length at 99 Hertz... Hit Ctrl-C to end.\n");
-}
-
-profile:hz:99
-{
- $task = (struct task_struct *)curtask;
- $my_q = (struct cfs_rq *)$task.se.cfs_rq;
- $len = (uint64)$my_q.nr_running;
- $len = ($len > 0) ? ($len - 1) : 0;
- // subtract currently running task
- @runqlen = lhist($len, 0, 100, 1);
-}
diff --git a/tools/runqlen.bt b/tools/runqlen.bt
index 99127aad..8c519c22 100644
--- a/tools/runqlen.bt
+++ b/tools/runqlen.bt
@@ -22,6 +22,8 @@
// This is a bpftrace version of the bcc tool of the same name.
// The bcc version provides options to customize the output.
//
+// For Linux < 6.14.
+//
// Copyright 2018 Netflix, Inc.
//
// 07-Oct-2018 Brendan Gregg Created this.
@@ -34,8 +36,8 @@
// your kernel version. It is from kernel/sched/sched.h:
struct cfs_rq {
struct load_weight load;
- unsigned int nr_queued;
- unsigned int h_nr_queued;
+ unsigned int nr_running;
+ unsigned int h_nr_running;
};
#endif
@@ -48,7 +50,7 @@ profile:hz:99
{
$task = (struct task_struct *)curtask;
$my_q = (struct cfs_rq *)$task.se.cfs_rq;
- $len = (uint64)$my_q.nr_queued;
+ $len = (uint64)$my_q.nr_running;
$len = ($len > 0) ? ($len - 1) : 0;
// subtract currently running task
@runqlen = lhist($len, 0, 100, 1);
--
2.52.0

View File

@ -1,5 +1,5 @@
Name: bpftrace
Version: 0.24.2
Version: 0.26.1
Release: 1%{?dist}
Summary: High-level tracing language for Linux eBPF
License: ASL 2.0
@ -62,7 +62,8 @@ export CPATH
%cmake . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_SHARED_LIBS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DUSE_SYSTEM_LIBBPF:BOOL=ON \
%cmake_build
@ -75,7 +76,7 @@ find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
%files
%doc README.md CONTRIBUTING-TOOLS.md
%doc README.md CONTRIBUTING.md
%doc docs/reference_guide.md docs/tutorial_one_liners.md
%license LICENSE
%dir %{_datadir}/%{name}
@ -92,6 +93,10 @@ find %{buildroot}%{_datadir}/%{name}/tools -type f -exec \
%exclude %{_datadir}/%{name}/tools/biolatency-kp.bt
%changelog
* Wed May 27 2026 Gregory Bell <grbell@redhat.com> - 0.26.0-1
- Rebase on bpftrace 0.26.1 (RHEL-162984)
- Rebuild with LLVM 22 (RHEL-170957)
* Tue Jan 13 2026 Viktor Malik <vmalik@redhat.com> - 0.24.2-1
- Rebase on bpftrace 0.24.2 (RHEL-140903)

View File

@ -1,2 +1,2 @@
SHA512 (bpftrace-0.24.2.tar.gz) = d9ff773ce39b578877d5e73a48434d3654b46985bb4b9ad458fbf622718049da5075b3a2d2e6d1ae0a9effbdb74658822b4c4535bca384fbd6e539fdec393f4b
SHA512 (cereal-1.3.2.tar.gz) = 98d306d6292789129675f1c5c5aedcb90cfcc1029c4482893a8f9b23f3c9755e5ed4762d7a528f215345cae6392e87cd8d89467115b6f031b41c8673d6b4b109
SHA512 (bpftrace-0.26.1.tar.gz) = 2b2f052b742317b991b2e267881167ec58f0b7fa24574950f090d237665930a7ddfaa26e9a9f03eb3db01ab111a99ecb8f4b41f1c944b6f1df0218f109bfe72d