Fix bio tools

Fix tp_args padding in bio* tools. This is an RHEL/Centos specific
fix.

Resolves: RHEL-61615

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
This commit is contained in:
Jerome Marchand 2024-10-24 17:04:24 +02:00
parent 1eb395b435
commit 0afa4cf2fa
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,61 @@
From 8a9da1d866dfb69ad1ca59bdc50a799ba2da3a0c Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Thu, 24 Oct 2024 16:56:14 +0200
Subject: [PATCH] RHEL/Centos: tools: fix alignment in tp_args for bio tools
The padding in tp_args is wrong on RHEL 9 / c9s kernel because of the
kernel commit 6bc27040eb90 ("sched: Add support for lazy preemption")
which added a common field to tracepoints.
Now the dev field is at an offset of 12 bytes as shown by
block_io_start/done format file.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
---
tools/biolatency.py | 2 +-
tools/biosnoop.py | 2 +-
tools/biotop.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/biolatency.py b/tools/biolatency.py
index 03b48a4c..ac150ea2 100755
--- a/tools/biolatency.py
+++ b/tools/biolatency.py
@@ -88,7 +88,7 @@ typedef struct ext_val {
} ext_val_t;
struct tp_args {
- u64 __unused__;
+ u32 __unused__[3];
dev_t dev;
sector_t sector;
unsigned int nr_sector;
diff --git a/tools/biosnoop.py b/tools/biosnoop.py
index f0fef98b..819e953f 100755
--- a/tools/biosnoop.py
+++ b/tools/biosnoop.py
@@ -66,7 +66,7 @@ struct val_t {
};
struct tp_args {
- u64 __unused__;
+ u32 __unused__[3];
dev_t dev;
sector_t sector;
unsigned int nr_sector;
diff --git a/tools/biotop.py b/tools/biotop.py
index 879c6b8f..4c3a1c9a 100755
--- a/tools/biotop.py
+++ b/tools/biotop.py
@@ -91,7 +91,7 @@ struct val_t {
};
struct tp_args {
- u64 __unused__;
+ u32 __unused__[3];
dev_t dev;
sector_t sector;
unsigned int nr_sector;
--
2.47.0

View File

@ -25,12 +25,13 @@
Name: bcc
Version: 0.30.0
Release: 6%{?dist}
Release: 7%{?dist}
Summary: BPF Compiler Collection (BCC)
License: ASL 2.0
URL: https://github.com/iovisor/bcc
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: %%{name}-%%{version}-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch
Patch1: %%{name}-%%{version}-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch
# Arches will be included as upstream support is added and dependencies are
@ -264,6 +265,9 @@ cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/
%endif
%changelog
* Thu Oct 24 2024 Jerome Marchand <jmarchan@redhat.com> - 0.30.0-7
- Fic bio* tools (RHEL-61615)
* Thu Jul 04 2024 Jerome Marchand <jmarchan@redhat.com> - 0.30.0-6
- Rebuild with LLVM 18 (RHEL-28684)