]> sourceware.org Git - systemtap.git/commitdiff
runtime: port to kernel 5.17-rc1+
authorFrank Ch. Eigler <fche@redhat.com>
Fri, 25 Feb 2022 00:35:32 +0000 (19:35 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Fri, 25 Feb 2022 00:35:32 +0000 (19:35 -0500)
LKML commit 6dfbbae14a7b961f41 changed the procfs pde-data API.
Adapt the runtime via an autoconf tester.

buildrun.cxx
runtime/linux/autoconf-pde_data.c [new file with mode: 0644]
runtime/proc_fs_compatibility.h
runtime/procfs-probes.c
runtime/procfs.c
session.cxx

index ecaeedaac69b15124078f9c907e2d07b734bd2cd..70ccfc30e7f2065e74d888d2ae49291f626aac75 100644 (file)
@@ -430,6 +430,7 @@ compile_pass (systemtap_session& s)
   output_exportconf(s, o2, "proc_create_data", "STAPCONF_PROC_CREATE_DATA");
   output_autoconf(s, o, cs, "autoconf-proc_ops.c", "STAPCONF_PROC_OPS", NULL);
   output_exportconf(s, o2, "PDE_DATA", "STAPCONF_PDE_DATA");
+  output_autoconf(s, o, cs, "autoconf-pde_data.c", "STAPCONF_PDE_DATA2", NULL);
   output_autoconf(s, o, cs, "autoconf-module-sect-attrs.c", "STAPCONF_MODULE_SECT_ATTRS", NULL);
   output_autoconf(s, o, cs, "autoconf-kernel_read-new-args.c", "STAPCONF_KERNEL_READ_NEW_ARGS", NULL);
   output_autoconf(s, o, cs, "autoconf-utrace-via-tracepoints.c", "STAPCONF_UTRACE_VIA_TRACEPOINTS", NULL);
diff --git a/runtime/linux/autoconf-pde_data.c b/runtime/linux/autoconf-pde_data.c
new file mode 100644 (file)
index 0000000..e8b5823
--- /dev/null
@@ -0,0 +1,10 @@
+/* detect
+   linux commit 6dfbbae14a7b961f41d80a106e1ab60e86d061c5
+   fs: proc: store PDE()->data into inode->i_private */
+
+#include <linux/proc_fs.h>
+
+void* __something(const struct inode* i)
+{
+        return pde_data (i);
+}
index c94da16d8ff091872f7ca004412745339d119b92..0e200c7ffbafbd8d8ca9fadb64fc9f8f5ff723e0 100644 (file)
@@ -17,7 +17,7 @@
 /* If STAPCONF_PDE_DATA isn't defined, we're using the original /proc
  * interface (where 'struct proc_dir_entry' isn't opaque). Provide
  * some of the new interface's functions. */
-#ifndef STAPCONF_PDE_DATA
+#if !defined(STAPCONF_PDE_DATA) && !defined(STAPCONF_PDE_DATA2)
 
 #ifndef STAPCONF_LINUX_UIDGID_H
 static void proc_set_user(struct proc_dir_entry *de, uid_t uid, gid_t gid)
index 96bacac85b610042b8cf1a77d9709d7219d5c3cd..15c5e3deed2918987ae532461c09afbb08736807 100644 (file)
@@ -56,7 +56,11 @@ _stp_proc_open_file(struct inode *inode, struct file *filp)
        struct stap_procfs_probe *spp;
        int res;
 
+#ifdef STAPCONF_PDE_DATA2
+       spp = (struct stap_procfs_probe *)pde_data(inode);
+#else
        spp = (struct stap_procfs_probe *)PDE_DATA(inode);
+#endif
        if (spp == NULL) {
                return -EINVAL;
        }
index c2b5aacf22c2ef22674e9c58cc8f589bad3d2b60..2d1f3736c8a5d73e3b0b6d028fc4231086c926c9 100644 (file)
 #include "uidgid_compatibility.h"
 
 
-/* If STAPCONF_PDE_DATA isn't defined, we're using the original /proc
+/* If STAPCONF_PDE_DATA* aren't defined, we're using the original /proc
  * interface (where 'struct proc_dir_entry' isn't opaque). In this
  * case allow the (undocumented) feature of slashes
  * (i.e. subdirectories) in paths. */
-#ifndef STAPCONF_PDE_DATA
+#if !defined(STAPCONF_PDE_DATA) && !defined(STAPCONF_PDE_DATA2)
 #define _STP_ALLOW_PROCFS_PATH_SUBDIRS
 #endif
 
index ec1400ee056c1d4b066932e2fbbda8b594798d04..ced67da5b150783c245c2aaad3ed9ae8e86bd118 100644 (file)
@@ -495,7 +495,7 @@ systemtap_session::version ()
              "Copyright (C) 2005-2021 Red Hat, Inc. and others\n"   // PRERELEASE
              "This is free software; see the source for copying conditions.\n",
              version_string().c_str());
-  cout << _F("tested kernel versions: %s ... %s\n", "2.6.32", "5.15.0-rc7");   // PRERELEASE
+  cout << _F("tested kernel versions: %s ... %s\n", "2.6.32", "5.17.0-rc4");   // PRERELEASE
   
   cout << _("enabled features:")
 #ifdef HAVE_AVAHI
This page took 0.042336 seconds and 5 git commands to generate.