]> sourceware.org Git - systemtap.git/commitdiff
Adapt hw_breakpoint.exp for Linux 5.7.0 proc_create
authorStan Cox <scox@redhat.com>
Thu, 26 May 2022 17:36:02 +0000 (13:36 -0400)
committerStan Cox <scox@redhat.com>
Thu, 26 May 2022 17:36:02 +0000 (13:36 -0400)
Linux 5.7.0 uses struct proc_ops instead of file_operations.
xfail if unable to get address from kallsyms

testsuite/systemtap.base/hw_breakpoint.exp
testsuite/systemtap.base/stap_hwbkpt_kmod.c

index 4f838be1c971e68cd3deb6e515821c7bd41d791b..92f778fd977557539c002f6476bd6153b7d76d3a 100644 (file)
@@ -114,6 +114,8 @@ if { $no_hardware_support == 1 } {
     xfail "$test - addr (kernel support, but no hardware support)"
 } elseif { $rc == 0 && $found == 1 } {
     pass "$test - addr (hw breakpoint support)"
+} elseif { $res == 0 } {
+    xfail "$test - addr {no module data address}"
 } else {
     fail "$test - addr ($rc, $found)"
 }
index b52b7e421b97ef030fb9fc808ac9d61d3694c6bb..98eb353c9a40f2f251991ffcd9e9fac80c0a2b18 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/proc_fs.h>
 #include <linux/compiler.h>
@@ -69,11 +70,18 @@ static ssize_t stm_read_cmd(struct file *file, char __user *buffer,
        return bytes;
 }
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5,6,0)
 static struct file_operations stm_fops_cmd = {
-       .owner = THIS_MODULE,
-       .write = stm_write_cmd,
+        .owner = THIS_MODULE,
+        .write = stm_write_cmd,
        .read = stm_read_cmd,
 };
+#else
+static struct proc_ops stm_fops_cmd = {
+  .proc_write = stm_write_cmd,
+  .proc_read = stm_read_cmd,
+};
+#endif
 
 #define CMD_FILE "stap_hwbkpt_cmd"
 
This page took 0.029514 seconds and 5 git commands to generate.