Blame SOURCES/redhat-bugzilla-2003956-pmdabcc-update-kernel-version-check-due-to-backporting.patch

e94686
bcc included in RHEL 8.6 doesn't support the kernel_struct_has_field function.
e94686
The 4.18.x kernel in RHEL 8.6 did backport the `state` to `__state` rename (upstream:
e94686
change was in kernel v5.14+), and now we're in a situation where we can't test for
e94686
the existence of this kernel struct member and also can't rely on a kernel version check.
e94686
e94686
Therefore, let's patch it here for RHEL 8.x only:
e94686
e94686
diff --git a/src/pmdas/bcc/modules/runqlat.python b/src/pmdas/bcc/modules/runqlat.python
e94686
index 1c6c6b4b0..efc30e958 100644
e94686
--- a/src/pmdas/bcc/modules/runqlat.python
e94686
+++ b/src/pmdas/bcc/modules/runqlat.python
e94686
@@ -100,7 +100,7 @@ class PCPBCCModule(PCPBCCBase):
e94686
                 if (
e94686
                     hasattr(BPF, "kernel_struct_has_field")
e94686
                     and BPF.kernel_struct_has_field(b"task_struct", b"__state") == 1
e94686
-                ) or self.kernel_version() >= (5, 14, 0):
e94686
+                ) or self.kernel_version() >= (4, 18, 0):
e94686
                     self.bpf_text = self.bpf_text.replace('STATE_FIELD', '__state')
e94686
                 else:
e94686
                     self.bpf_text = self.bpf_text.replace('STATE_FIELD', 'state')