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

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