]> sourceware.org Git - systemtap.git/commitdiff
Support fallback kernel dump_stack() with or without bp argument.
authorMark Wielaard <mjw@redhat.com>
Tue, 29 Nov 2011 11:32:05 +0000 (12:32 +0100)
committerMark Wielaard <mjw@redhat.com>
Tue, 29 Nov 2011 11:54:50 +0000 (12:54 +0100)
There has been some flip-flopping in the kernel whether or not dump_stack()
takes a bp argument. We now support either with or without.
See linux commits v2.6.36-9872-g9c0729d and v2.6.38-793-ge8e999c.

buildrun.cxx
runtime/stack.c

index 3fe3461c570b0eef26dc8dc1f0ba653326b59841..d6d2990a713f57526148e120a70d6c62f63f7eb7 100644 (file)
@@ -265,6 +265,8 @@ compile_pass (systemtap_session& s)
                  "STAPCONF_HW_BREAKPOINT_CONTEXT", NULL);
   output_autoconf(s, o, "autoconf-save-stack-trace.c",
                   "STAPCONF_KERNEL_STACKTRACE", NULL);
+  output_autoconf(s, o, "autoconf-save-stack-trace-no-bp.c",
+                  "STAPCONF_KERNEL_STACKTRACE_NO_BP", NULL);
   output_autoconf(s, o, "autoconf-asm-syscall.c",
                  "STAPCONF_ASM_SYSCALL_H", NULL);
   output_autoconf(s, o, "autoconf-ring_buffer-flags.c", "STAPCONF_RING_BUFFER_FLAGS", NULL);
index 1d4dde018feacc27f4caefe598faae24c5570d1e..1a3fe94d50c3078103ebf82450e66555f4c84a23 100644 (file)
@@ -50,7 +50,7 @@
 struct uretprobe_instance;
 #endif
 
-#if defined(STAPCONF_KERNEL_STACKTRACE)
+#if defined(STAPCONF_KERNEL_STACKTRACE) || defined(STAPCONF_KERNEL_STACKTRACE_NO_BP)
 #include <linux/stacktrace.h>
 #include <asm/stacktrace.h>
 #endif
@@ -73,7 +73,7 @@ static void _stp_stack_print_fallback(unsigned long, int, int, int);
 #endif
 #endif
 
-#if defined(STAPCONF_KERNEL_STACKTRACE)
+#if defined(STAPCONF_KERNEL_STACKTRACE) || defined(STAPCONF_KERNEL_STACKTRACE_NO_BP)
 
 struct print_stack_data
 {
@@ -131,8 +131,14 @@ static void _stp_stack_print_fallback(unsigned long stack,
         print_data.flags = sym_flags;
         print_data.levels = levels;
         print_data.skip = skip;
+#if defined(STAPCONF_KERNEL_STACKTRACE)
         dump_trace(current, NULL, (long *)stack, 0, &print_stack_ops,
                    &print_data);
+#else
+       /* STAPCONF_KERNEL_STACKTRACE_NO_BP */
+        dump_trace(current, NULL, (long *)stack, &print_stack_ops,
+                   &print_data);
+#endif
 }
 #else
 static void _stp_stack_print_fallback(unsigned long s, int v, int l, int k) {
@@ -140,7 +146,7 @@ static void _stp_stack_print_fallback(unsigned long s, int v, int l, int k) {
        _stp_print_addr(0, v | _STP_SYM_INEXACT, NULL);
 }
 
-#endif /* defined(STAPCONF_KERNEL_STACKTRACE) */
+#endif /* defined(STAPCONF_KERNEL_STACKTRACE) || defined(STAPCONF_KERNEL_STACKTRACE_NO_BP) */
 
 // Without KPROBES very little works atm.
 // But this file is unconditionally imported, while these two functions are only
@@ -234,7 +240,7 @@ static void _stp_stack_kernel_print(struct context *c, int sym_flags)
                   a pretty good guess at the stack value,
                   otherwise let dump_stack guess it
                   (and skip some framework frames). */
-#if defined(STAPCONF_KERNEL_STACKTRACE)
+#if defined(STAPCONF_KERNEL_STACKTRACE) || defined(STAPCONF_KERNEL_STACKTRACE_NO_BP)
                unsigned long sp;
                int skip;
 #ifdef CONFIG_FRAME_POINTER
This page took 0.033134 seconds and 5 git commands to generate.