]> sourceware.org Git - systemtap.git/commitdiff
runtime: port to kernel 5.15-rc
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 1 Nov 2021 14:08:13 +0000 (10:08 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 1 Nov 2021 14:08:13 +0000 (10:08 -0400)
get_mm_exe_file got unexported.  Deal with it the usual way.

buildrun.cxx
runtime/linux/runtime.h
runtime/task_finder_vma.c
runtime/transport/transport.c

index 086ecca618e3cd3b4933ec76c274ce19535d6b9b..2a18fe3b765397d322badb3df969ff9efab62352 100644 (file)
@@ -370,7 +370,7 @@ compile_pass (systemtap_session& s)
   output_exportconf(s, o2, "synchronize_sched", "STAPCONF_SYNCHRONIZE_SCHED");
   output_autoconf(s, o, cs, "autoconf-task-uid.c", "STAPCONF_TASK_UID", NULL);
   output_autoconf(s, o, cs, "autoconf-from_kuid_munged.c", "STAPCONF_FROM_KUID_MUNGED", NULL);
-  output_exportconf(s, o2, "get_mm_exe_file", "STAPCONF_GET_MM_EXE_FILE");
+  output_exportconf(s, o2, "get_mm_exe_file", "STAPCONF_GET_MM_EXE_FILE_EXPORTED");
   output_dual_exportconf(s, o2, "alloc_vm_area", "free_vm_area", "STAPCONF_VM_AREA");
   output_autoconf(s, o, cs, "autoconf-procfs-owner.c", "STAPCONF_PROCFS_OWNER", NULL);
   output_autoconf(s, o, cs, "autoconf-alloc-percpu-align.c", "STAPCONF_ALLOC_PERCPU_ALIGN", NULL);
index 880c1fa4a1758bab5d991c079e2d0ea656f16a6a..77291f092d47b07ecc1f09791580b2ea0df539d8 100644 (file)
@@ -255,6 +255,9 @@ static void *kallsyms_signal_wake_up;
 #if !defined(STAPCONF___LOCK_TASK_SIGHAND_EXPORTED)
 static void *kallsyms___lock_task_sighand;
 #endif
+#if !defined(STAPCONF_GET_MM_EXE_FILE_EXPORTED)
+static void *kallsyms_get_mm_exe_file;
+#endif
 
 #include "access_process_vm.h"
 #include "loc2c-runtime.h"
index 81a96c7cf8ecf8e5f2394784d74dd59833b7178d..134df8c50bf0c6e861b94bea61bd9549936a0e7f 100644 (file)
@@ -420,8 +420,14 @@ stap_find_exe_file(struct mm_struct* mm)
        // still use our own code. The original get_mm_exe_file() can
        // sleep (since it calls down_read()), so we'll have to roll
        // our own.
-#if defined(STAPCONF_DPATH_PATH) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
+#if defined(STAPCONF_GET_MM_EXE_FILE_EXPORTED) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
        return get_mm_exe_file(mm);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
+        typedef typeof(&get_mm_exe_file) get_mm_exe_file_fn;
+        if (kallsyms_get_mm_exe_file == NULL)
+          return NULL; /* can't happen; _stp_handle_start would abort before this point */
+        else
+          return (* (get_mm_exe_file_fn) kallsyms_get_mm_exe_file)(mm);
 #else
        struct file *exe_file = NULL;
 
index 9b9d6cbe249183a8c5a7593170ca3121becc7efe..3e128c92c964dbfe8d0f34369240292afd076d24 100644 (file)
@@ -363,6 +363,13 @@ static int _stp_handle_kallsyms_lookups(void)
                 goto err0;
         }
 #endif
+#if !defined(STAPCONF_GET_MM_EXE_FILE_EXPORTED) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0))
+        kallsyms_get_mm_exe_file = (void*) kallsyms_lookup_name ("get_mm_exe_file");
+        if (kallsyms_get_mm_exe_file == NULL) {
+                _stp_error("Can't resolve get_mm_exe_file!");
+                goto err0;
+        }
+#endif
 #endif
 #if defined(CONFIG_KALLSYMS) && !defined(STAPCONF_KALLSYMS_LOOKUP_NAME_EXPORTED)
         {
This page took 0.033681 seconds and 5 git commands to generate.