- libcfs_debug_dumpstack(NULL);
- libcfs_debug_dumplog();
- libcfs_run_lbug_upcall(file, func, line);
- if (libcfs_panic_on_lbug)
- panic("LBUG");
- set_task_state(current, TASK_UNINTERRUPTIBLE);
- while (1)
- schedule();
+static const struct stacktrace_ops print_trace_ops = {
+#ifdef HAVE_STACKTRACE_WARNING
+ .warning = print_trace_warning,
+ .warning_symbol = print_trace_warning_symbol,
+#endif
+ .stack = print_trace_stack,
+ .address = print_trace_address,
+#ifdef STACKTRACE_OPS_HAVE_WALK_STACK
+ .walk_stack = print_context_stack,
+#endif
+};
+#endif /* HAVE_STACKTRACE_OPS */
+
+static void libcfs_call_trace(struct task_struct *tsk)
+{
+#ifdef HAVE_STACKTRACE_OPS
+ printk("Pid: %d, comm: %.20s\n", tsk->pid, tsk->comm);
+ 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");
+#else /* !HAVE_STACKTRACE_OPS */
+ if (tsk == current)
+ dump_stack();
+ else
+ CWARN("can't show stack: kernel doesn't export show_task\n");
+#endif /* HAVE_STACKTRACE_OPS */