Blame SOURCES/redhat-bugzilla-1597975.patch

59923c
From 6476a7e81eba04a729380b813d6555cdca2acb1a Mon Sep 17 00:00:00 2001
59923c
From: Marko Myllynen <myllynen@redhat.com>
59923c
Date: Thu, 5 Jul 2018 08:59:35 +0300
59923c
Subject: [PATCH] pmdabcc: fix ext4dist/xfsdist for RHEL 7 kernel
59923c
59923c
RHEL 7 kernel is unlike Fedora / upstream kernels, apply the
59923c
corresponding change done in latest RHEL 7 bcc as well.
59923c
---
59923c
 src/pmdas/bcc/modules/fs/ext4dist.bpf    | 1 +
59923c
 src/pmdas/bcc/modules/fs/ext4dist.python | 8 ++++----
59923c
 src/pmdas/bcc/modules/fs/xfsdist.bpf     | 1 +
59923c
 src/pmdas/bcc/modules/fs/xfsdist.python  | 8 ++++----
59923c
 4 files changed, 10 insertions(+), 8 deletions(-)
59923c
59923c
diff -Naurp pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/ext4dist.bpf pcp-4.3.0/src/pmdas/bcc/modules/fs/ext4dist.bpf
59923c
--- pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/ext4dist.bpf	2018-05-28 11:27:04.000000000 +1000
59923c
+++ pcp-4.3.0/src/pmdas/bcc/modules/fs/ext4dist.bpf	2019-01-29 13:00:29.057576352 +1100
59923c
@@ -3,6 +3,7 @@
59923c
 
59923c
 #include <uapi/linux/ptrace.h>
59923c
 #include <linux/fs.h>
59923c
+#include <linux/aio.h>
59923c
 #include <linux/sched.h>
59923c
 
59923c
 #define OP_NAME_LEN 8
59923c
diff -Naurp pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/ext4dist.python pcp-4.3.0/src/pmdas/bcc/modules/fs/ext4dist.python
59923c
--- pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/ext4dist.python	2018-09-18 16:41:15.000000000 +1000
59923c
+++ pcp-4.3.0/src/pmdas/bcc/modules/fs/ext4dist.python	2019-01-29 13:03:26.656105696 +1100
59923c
@@ -121,16 +121,12 @@ class PCPBCCModule(PCPBCCBase):
59923c
             self.reset_cache()
59923c
             self.bpf = BPF(text=bpf_text)
59923c
             # Compat: bcc < 0.6.0 (first check)
59923c
-            if 'get_kprobe_functions' in dir(self.bpf) and \
59923c
-               self.get_kprobe_functions(b"ext4_file_read_iter"):
59923c
-                self.bpf.attach_kprobe(event="ext4_file_read_iter", fn_name="trace_entry")
59923c
-            else:
59923c
-                self.bpf.attach_kprobe(event="generic_file_read_iter", fn_name="trace_read_entry")
59923c
-            self.bpf.attach_kprobe(event="ext4_file_write_iter", fn_name="trace_entry")
59923c
+            self.bpf.attach_kprobe(event="generic_file_aio_read", fn_name="trace_read_entry")
59923c
+            self.bpf.attach_kprobe(event="ext4_file_write", fn_name="trace_entry")
59923c
             self.bpf.attach_kprobe(event="ext4_file_open", fn_name="trace_entry")
59923c
             self.bpf.attach_kprobe(event="ext4_sync_file", fn_name="trace_entry")
59923c
-            self.bpf.attach_kretprobe(event="generic_file_read_iter", fn_name="trace_read_return")
59923c
-            self.bpf.attach_kretprobe(event="ext4_file_write_iter", fn_name="trace_write_return")
59923c
+            self.bpf.attach_kretprobe(event="generic_file_aio_read", fn_name="trace_read_return")
59923c
+            self.bpf.attach_kretprobe(event="ext4_file_write", fn_name="trace_write_return")
59923c
             self.bpf.attach_kretprobe(event="ext4_file_open", fn_name="trace_open_return")
59923c
             self.bpf.attach_kretprobe(event="ext4_sync_file", fn_name="trace_fsync_return")
59923c
             self.log("Compiled.")
59923c
diff -Naurp pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/xfsdist.bpf pcp-4.3.0/src/pmdas/bcc/modules/fs/xfsdist.bpf
59923c
--- pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/xfsdist.bpf	2018-06-19 09:19:05.000000000 +1000
59923c
+++ pcp-4.3.0/src/pmdas/bcc/modules/fs/xfsdist.bpf	2019-01-29 13:00:29.060576310 +1100
59923c
@@ -3,6 +3,7 @@
59923c
 
59923c
 #include <uapi/linux/ptrace.h>
59923c
 #include <linux/fs.h>
59923c
+#include <linux/aio.h>
59923c
 #include <linux/sched.h>
59923c
 
59923c
 #define OP_NAME_LEN 8
59923c
diff -Naurp pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/xfsdist.python pcp-4.3.0/src/pmdas/bcc/modules/fs/xfsdist.python
59923c
--- pcp-4.3.0.orig/src/pmdas/bcc/modules/fs/xfsdist.python	2018-09-18 16:41:15.000000000 +1000
59923c
+++ pcp-4.3.0/src/pmdas/bcc/modules/fs/xfsdist.python	2019-01-29 13:00:29.061576296 +1100
59923c
@@ -102,12 +102,12 @@ class PCPBCCModule(PCPBCCBase):
59923c
 
59923c
             self.reset_cache()
59923c
             self.bpf = BPF(text=bpf_text)
59923c
-            self.bpf.attach_kprobe(event="xfs_file_read_iter", fn_name="trace_entry")
59923c
-            self.bpf.attach_kprobe(event="xfs_file_write_iter", fn_name="trace_entry")
59923c
+            self.bpf.attach_kprobe(event="xfs_file_aio_read", fn_name="trace_entry")
59923c
+            self.bpf.attach_kprobe(event="xfs_file_aio_write", fn_name="trace_entry")
59923c
             self.bpf.attach_kprobe(event="xfs_file_open", fn_name="trace_entry")
59923c
             self.bpf.attach_kprobe(event="xfs_file_fsync", fn_name="trace_entry")
59923c
-            self.bpf.attach_kretprobe(event="xfs_file_read_iter", fn_name="trace_read_return")
59923c
-            self.bpf.attach_kretprobe(event="xfs_file_write_iter", fn_name="trace_write_return")
59923c
+            self.bpf.attach_kretprobe(event="xfs_file_aio_read", fn_name="trace_read_return")
59923c
+            self.bpf.attach_kretprobe(event="xfs_file_aio_write", fn_name="trace_write_return")
59923c
             self.bpf.attach_kretprobe(event="xfs_file_open", fn_name="trace_open_return")
59923c
             self.bpf.attach_kretprobe(event="xfs_file_fsync", fn_name="trace_fsync_return")
59923c
             self.log("Compiled.")