From: Tomas Glozar tglozar@redhat.com
redhat/kernel.spec.template: Build rtla with BPF sample collection
Sample collection using BPF was introduced in 6.15 as a faster default mechanism. The previous implementation using a tracefs pipe is now a fallback.
This allows rtla to work properly when measuring on a large number of CPUs, as well as reduces CPU usage on all systems.
Add build dependency on libbpf-devel, bpftool, and clang, and runtime dependency on libbpf for rtla in order to enable rtla BPF sample collection.
Signed-off-by: Tomas Glozar tglozar@redhat.com
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -755,6 +755,9 @@ BuildRequires: libcap-devel libcap-ng-devel BuildRequires: python3-docutils BuildRequires: libtraceevent-devel BuildRequires: libtracefs-devel +BuildRequires: libbpf-devel +BuildRequires: bpftool +BuildRequires: clang
%ifnarch s390x BuildRequires: pciutils-devel @@ -1311,6 +1314,7 @@ Epoch: %{gemini} Summary: Real-Time Linux Analysis tools Requires: libtraceevent Requires: libtracefs +Requires: libbpf %ifarch %{cpupowerarchs} Requires: %{package_name}-tools-libs = %{version}-%{release} %endif
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3815
From: Tomas Glozar on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3815#note_2434334...
Verified that BPF sample collection is indeed working in ARK kernel after the spec update:
``` tglozar@cs10:~$ uname -a Linux cs10 6.14.0-10.3815_1750908656.el10.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 3 12:05:40 EDT 2025 x86_64 GNU/Linux tglozar@cs10:~$ rtla --version
rtla version 6.14.0-10.3815_1750908656.el10.x86_64
usage: rtla COMMAND ...
commands: osnoise - gives information about the operating system noise (osnoise) hwnoise - gives information about hardware-related noise timerlat - measures the timer irq and thread latency tglozar@cs10:~$ ldd /usr/bin/rtla linux-vdso.so.1 (0x00007fe014aea000) libtraceevent.so.1 => /lib64/libtraceevent.so.1 (0x00007fe014a92000) libtracefs.so.1 => /lib64/libtracefs.so.1 (0x00007fe014a6a000) libcpupower.so.1 => /lib64/libcpupower.so.1 (0x00007fe014a61000) libbpf.so.1 => /lib64/libbpf.so.1 (0x00007fe0149fb000) libc.so.6 => /lib64/libc.so.6 (0x00007fe014822000) libelf.so.1 => /lib64/libelf.so.1 (0x00007fe014805000) libz.so.1 => /lib64/libz.so.1 (0x00007fe0147e2000) /lib64/ld-linux-x86-64.so.2 (0x00007fe014aec000) libzstd.so.1 => /lib64/libzstd.so.1 (0x00007fe014731000) tglozar@cs10:~$ sudo rtla timerlat top -D -q -d 10s setting cpus to all from 0-13 reading osnoise/stop_tracing_us returned 0 setting osnoise/stop_tracing_us to 0 reading osnoise/stop_tracing_total_us returned 0 setting osnoise/stop_tracing_total_us to 0 reading osnoise/timerlat_period_us returned 1000 setting osnoise/timerlat_period_us to 1000 reading osnoise/print_stack returned 0 setting osnoise/print_stack to 0 User-space interface detected, setting user-threads Loading BPF program Enabling timerlat tracer Attaching BPF program Dispatching timerlat u procs User-space timerlat pid 4976 on cpu 0 User-space timerlat pid 4977 on cpu 1 User-space timerlat pid 4978 on cpu 2 User-space timerlat pid 4979 on cpu 3 User-space timerlat pid 4980 on cpu 4 User-space timerlat pid 4982 on cpu 6 User-space timerlat pid 4983 on cpu 7 User-space timerlat pid 4984 on cpu 8 User-space timerlat pid 4985 on cpu 9 User-space timerlat pid 4986 on cpu 10 User-space timerlat pid 4981 on cpu 5 User-space timerlat pid 4987 on cpu 11 User-space timerlat pid 4988 on cpu 12 User-space timerlat pid 4989 on cpu 13 Timer Latency 0 00:00:11 | IRQ Timer Latency (us) | Thread Timer Latency (us) | Ret user Timer Latency (us) CPU COUNT | cur min avg max | cur min avg max | cur min avg max 0 #10001 | 9 0 7 474 | 19 3 18 645 | 23 4 21 648 1 #10000 | 10 0 3 462 | 20 2 10 466 | 24 3 13 469 2 #10000 | 1 0 6 464 | 4 3 16 476 | 5 3 19 480 3 #10000 | 13 0 5 567 | 21 2 12 579 | 25 3 15 583 4 #10001 | 9 0 4 498 | 19 2 11 503 | 23 3 13 505 5 #10001 | 7 0 2 630 | 14 2 8 642 | 18 3 10 646 6 #10000 | 1 0 2 229 | 4 2 7 252 | 5 3 8 286 7 #10000 | 2 0 7 535 | 11 3 17 539 | 14 3 21 541 8 #10000 | 2 0 5 315 | 9 2 15 327 | 12 3 19 331 9 #10001 | 1 0 3 559 | 4 2 9 571 | 5 3 11 575 10 #10000 | 9 0 5 497 | 19 2 13 508 | 23 3 16 514 11 #10001 | 1 0 5 568 | 4 2 14 580 | 5 3 18 584 12 #10000 | 3 0 5 642 | 10 2 15 654 | 14 3 18 658 13 #10000 | 11 0 2 482 | 20 2 7 492 | 24 3 9 496 ---------------|----------------------------------------|--------------------- -------------------|--------------------------------------- ALL #140005 e0 | 0 4 642 | 2 12 654 | 3 15 658 restoring cpus to 0-13 tglozar@cs10:~$ ```
kernel@lists.fedoraproject.org