dump_trace() is a X86 specific function. It will cause
compilation failure if the architecture is not X86. A more
general function dump_stack() should be called under that
environment.
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I8a5fffa6dec15dc8c779a22e24c10b364c77f9a0
Reviewed-on: http://review.whamcloud.com/8872
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
#include <linux/nmi.h>
#include <asm/stacktrace.h>
#include <linux/nmi.h>
#include <asm/stacktrace.h>
+static void libcfs_call_trace(struct task_struct *tsk)
+{
+ dump_trace(tsk, NULL, NULL,
+#ifdef HAVE_DUMP_TRACE_ADDRESS
+ 0,
+#endif /* HAVE_DUMP_TRACE_ADDRESS */
+ &print_trace_ops, NULL);
+ printk("\n");
+}
+
+#else /* !CONFIG_X86 */
+
+static void libcfs_call_trace(struct task_struct *tsk)
+{
+ if ((tsk == NULL) || (tsk == current))
+ dump_stack();
+ else
+ CWARN("can't show stack: kernel doesn't export show_task\n");
+}
+
+#endif /* CONFIG_X86 */
+
void libcfs_debug_dumpstack(struct task_struct *tsk)
{
/* dump_stack() */
void libcfs_debug_dumpstack(struct task_struct *tsk)
{
/* dump_stack() */
printk("Pid: %d, comm: %.20s\n", tsk->pid, tsk->comm);
/* show_trace_log_lvl() */
printk("\nCall Trace:\n");
printk("Pid: %d, comm: %.20s\n", tsk->pid, tsk->comm);
/* show_trace_log_lvl() */
printk("\nCall Trace:\n");
- dump_trace(tsk, NULL, NULL,
-#ifdef HAVE_DUMP_TRACE_ADDRESS
- 0,
-#endif /* HAVE_DUMP_TRACE_ADDRESS */
- &print_trace_ops, NULL);
- printk("\n");
+ libcfs_call_trace(tsk);
}
struct task_struct *libcfs_current(void)
}
struct task_struct *libcfs_current(void)
if (in_interrupt()) {
cfs_trace_debug_print();
} else {
if (in_interrupt()) {
cfs_trace_debug_print();
} else {
-# ifdef HAVE_KERNEL_LOCKED
+#ifdef HAVE_KERNEL_LOCKED
while (kernel_locked())
unlock_kernel();
while (kernel_locked())
unlock_kernel();
libcfs_debug_dumplog_internal((void *)(long)current_pid());
}
#endif
libcfs_debug_dumplog_internal((void *)(long)current_pid());
}
#endif