]> sourceware.org Git - systemtap.git/commitdiff
Fix PR20158 by updating the runtime for the 4.6 kernel.
authorDavid Smith <dsmith@redhat.com>
Fri, 27 May 2016 16:19:03 +0000 (11:19 -0500)
committerDavid Smith <dsmith@redhat.com>
Fri, 27 May 2016 16:19:03 +0000 (11:19 -0500)
* buildrun.cxx (compile_pass): Added autoconf-stacktrace_ops-int-address.c
  compile test.
* stack.c: (print_stack_address): If STAPCONF_STACKTRACE_OPS_INT_ADDRESS
  is defined, the function returns a int instead of being a void
  function.
* runtime/linux/autoconf-stacktrace_ops-int-address.c: New autoconf-style
  test.

buildrun.cxx
runtime/linux/autoconf-stacktrace_ops-int-address.c [new file with mode: 0644]
runtime/stack.c

index 27e2be6a2dc36bf3c0cc84d618e58f2f7944d534..7c68ba03e0259d20b451e3d9a8bbfdd201e2451a 100644 (file)
@@ -371,6 +371,8 @@ compile_pass (systemtap_session& s)
   output_autoconf(s, o, "autoconf-walk-stack.c", "STAPCONF_WALK_STACK", NULL);
   output_autoconf(s, o, "autoconf-stacktrace_ops-warning.c",
                   "STAPCONF_STACKTRACE_OPS_WARNING", NULL);
+  output_autoconf(s, o, "autoconf-stacktrace_ops-int-address.c",
+                  "STAPCONF_STACKTRACE_OPS_INT_ADDRESS", NULL);
   output_autoconf(s, o, "autoconf-mm-context-vdso.c", "STAPCONF_MM_CONTEXT_VDSO", NULL);
   output_autoconf(s, o, "autoconf-mm-context-vdso-base.c", "STAPCONF_MM_CONTEXT_VDSO_BASE", NULL);
   output_autoconf(s, o, "autoconf-blk-types.c", "STAPCONF_BLK_TYPES", NULL);
diff --git a/runtime/linux/autoconf-stacktrace_ops-int-address.c b/runtime/linux/autoconf-stacktrace_ops-int-address.c
new file mode 100644 (file)
index 0000000..8ca277a
--- /dev/null
@@ -0,0 +1,14 @@
+#include <linux/sched.h>
+#include <asm/stacktrace.h>
+
+// check for 4.6 patch which changed the function signature of
+// stacktrace_ops 'address' member.
+
+int print_stack_address(void *data __attribute__ ((unused)),
+                       unsigned long addr __attribute__ ((unused)),
+                       int reliable __attribute__ ((unused)))
+{
+    return 0;
+}
+
+struct stacktrace_ops ops __attribute__ ((unused)) = {.address=print_stack_address};
index a7d03db722d5c263b6d575f17104cc3ef326d953..a99bad062382fb7137106427d14a3402cc8f094a 100644 (file)
@@ -111,7 +111,11 @@ static int print_stack_stack(void *data, char *name)
        return -1;
 }
 
+#ifdef STAPCONF_STACKTRACE_OPS_INT_ADDRESS
+static int print_stack_address(void *data, unsigned long addr, int reliable)
+#else
 static void print_stack_address(void *data, unsigned long addr, int reliable)
+#endif
 {
        struct print_stack_data *sdata = data;
        if (sdata->skip > 0)
@@ -122,6 +126,9 @@ static void print_stack_address(void *data, unsigned long addr, int reliable)
                                NULL);
                sdata->levels--;
        }
+#ifdef STAPCONF_STACKTRACE_OPS_INT_ADDRESS
+       return 0;
+#endif
 }
 
 static const struct stacktrace_ops print_stack_ops = {
This page took 0.035526 seconds and 5 git commands to generate.