X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=libcfs%2Flibcfs%2Flinux%2Flinux-debug.c;h=e046773e03047ae31528075787963f61f98182ea;hb=b7835ef5f56f439a522eca66350e698383f73165;hp=db049fed29dfcb28a6f15c0936e3af3f7e01232a;hpb=e3a7c58aebafce40323db54bf6056029e5af4a70;p=fs%2Flustre-release.git diff --git a/libcfs/libcfs/linux/linux-debug.c b/libcfs/libcfs/linux/linux-debug.c index db049fe..e046773 100644 --- a/libcfs/libcfs/linux/linux-debug.c +++ b/libcfs/libcfs/linux/linux-debug.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Whamcloud, Inc. + * Copyright (c) 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -38,13 +38,6 @@ * Author: Phil Schwan */ -#ifndef EXPORT_SYMTAB -# define EXPORT_SYMTAB -#endif - -#ifndef AUTOCONF_INCLUDED -#include -#endif #include #include #include @@ -53,10 +46,11 @@ #include #include #include +#ifdef HAVE_KERNEL_LOCKED #include +#endif #include #include -#include #include #include @@ -166,18 +160,6 @@ void libcfs_run_lbug_upcall(struct libcfs_debug_msg_data *msgdata) libcfs_run_upcall (argv); } -#ifdef __arch_um__ -void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) -{ - libcfs_catastrophe = 1; - libcfs_debug_msg(msgdata, "LBUG - trying to dump log to %s\n", - libcfs_debug_file_path); - libcfs_debug_dumplog(); - libcfs_run_lbug_upcall(msgdata); - asm("int $3"); - panic("LBUG"); -} -#else /* coverity[+kill] */ void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) { @@ -199,7 +181,6 @@ void lbug_with_loc(struct libcfs_debug_msg_data *msgdata) while (1) schedule(); } -#endif /* __arch_um__ */ #ifdef __KERNEL__ @@ -260,12 +241,7 @@ static DUMP_TRACE_CONST struct stacktrace_ops print_trace_ops = { void libcfs_debug_dumpstack(struct task_struct *tsk) { -#if defined(__arch_um__) - if (tsk != NULL) - CWARN("stack dump for pid %d (%d) requested; wake up gdb.\n", - tsk->pid, UML_PID(tsk)); - //asm("int $3"); -#elif defined(HAVE_DUMP_TRACE) +#if defined(HAVE_DUMP_TRACE) /* dump_stack() */ /* show_trace() */ if (tsk == NULL) @@ -317,9 +293,10 @@ static int panic_notifier(struct notifier_block *self, unsigned long unused1, if (in_interrupt()) { cfs_trace_debug_print(); } else { - while (current->lock_depth >= 0) - unlock_kernel(); - +# ifdef HAVE_KERNEL_LOCKED + while (kernel_locked()) + unlock_kernel(); +# endif libcfs_debug_dumplog_internal((void *)(long)cfs_curproc_pid()); } #endif