|
|
afd259 |
From 6516fb0d00208f05b29f320176204957b02b23e3 Mon Sep 17 00:00:00 2001
|
|
|
afd259 |
From: Jerome Marchand <jmarchan@redhat.com>
|
|
|
afd259 |
Date: Mon, 26 Jul 2021 12:05:57 +0200
|
|
|
afd259 |
Subject: [PATCH] Define KERNEL_VERSION
|
|
|
afd259 |
|
|
|
afd259 |
The libbpf version on RHEL9 doesn't define it.
|
|
|
afd259 |
---
|
|
|
afd259 |
libbpf-tools/biolatency.bpf.c | 2 ++
|
|
|
afd259 |
libbpf-tools/biosnoop.bpf.c | 2 ++
|
|
|
afd259 |
libbpf-tools/bitesize.bpf.c | 2 ++
|
|
|
afd259 |
3 files changed, 6 insertions(+)
|
|
|
afd259 |
|
|
|
afd259 |
diff --git a/libbpf-tools/biolatency.bpf.c b/libbpf-tools/biolatency.bpf.c
|
|
|
afd259 |
index 8d8fe584..8e6e81e2 100644
|
|
|
afd259 |
--- a/libbpf-tools/biolatency.bpf.c
|
|
|
afd259 |
+++ b/libbpf-tools/biolatency.bpf.c
|
|
|
afd259 |
@@ -9,6 +9,8 @@
|
|
|
afd259 |
|
|
|
afd259 |
#define MAX_ENTRIES 10240
|
|
|
afd259 |
|
|
|
afd259 |
+#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
|
|
|
afd259 |
+
|
|
|
afd259 |
extern int LINUX_KERNEL_VERSION __kconfig;
|
|
|
afd259 |
|
|
|
afd259 |
const volatile bool targ_per_disk = false;
|
|
|
afd259 |
diff --git a/libbpf-tools/biosnoop.bpf.c b/libbpf-tools/biosnoop.bpf.c
|
|
|
afd259 |
index 76697967..7b7cb1a4 100644
|
|
|
afd259 |
--- a/libbpf-tools/biosnoop.bpf.c
|
|
|
afd259 |
+++ b/libbpf-tools/biosnoop.bpf.c
|
|
|
afd259 |
@@ -11,6 +11,8 @@
|
|
|
afd259 |
const volatile bool targ_queued = false;
|
|
|
afd259 |
const volatile dev_t targ_dev = -1;
|
|
|
afd259 |
|
|
|
afd259 |
+#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
|
|
|
afd259 |
+
|
|
|
afd259 |
extern __u32 LINUX_KERNEL_VERSION __kconfig;
|
|
|
afd259 |
|
|
|
afd259 |
struct piddata {
|
|
|
afd259 |
diff --git a/libbpf-tools/bitesize.bpf.c b/libbpf-tools/bitesize.bpf.c
|
|
|
afd259 |
index 7b4d3f9d..5e7d9d97 100644
|
|
|
afd259 |
--- a/libbpf-tools/bitesize.bpf.c
|
|
|
afd259 |
+++ b/libbpf-tools/bitesize.bpf.c
|
|
|
afd259 |
@@ -10,6 +10,8 @@
|
|
|
afd259 |
const volatile char targ_comm[TASK_COMM_LEN] = {};
|
|
|
afd259 |
const volatile dev_t targ_dev = -1;
|
|
|
afd259 |
|
|
|
afd259 |
+#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
|
|
|
afd259 |
+
|
|
|
afd259 |
extern __u32 LINUX_KERNEL_VERSION __kconfig;
|
|
|
afd259 |
|
|
|
afd259 |
struct {
|
|
|
afd259 |
--
|
|
|
afd259 |
2.31.1
|
|
|
afd259 |
|