-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* libcfs/libcfs/debug.c
*
* Author: Phil Schwan <phil@clusterfs.com>
+ *
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
# define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
"Lustre kernel debug subsystem mask");
EXPORT_SYMBOL(libcfs_subsystem_debug);
-unsigned int libcfs_debug = (D_EMERG | D_ERROR | D_WARNING | D_CONSOLE |
+unsigned int libcfs_debug = (D_CANTMASK |
D_NETERROR | D_HA | D_CONFIG | D_IOCTL);
CFS_MODULE_PARM(libcfs_debug, "i", int, 0644,
"Lustre kernel debug mask");
"Total debug buffer size.");
EXPORT_SYMBOL(libcfs_debug_mb);
-unsigned int libcfs_printk = (D_CANTMASK | D_NETERROR);
+unsigned int libcfs_printk = D_CANTMASK;
CFS_MODULE_PARM(libcfs_printk, "i", uint, 0644,
"Lustre kernel debug console mask");
EXPORT_SYMBOL(libcfs_printk);
"Lustre kernel debug console ratelimit (0 to disable)");
EXPORT_SYMBOL(libcfs_console_ratelimit);
-cfs_duration_t libcfs_console_max_delay;
-CFS_MODULE_PARM(libcfs_console_max_delay, "l", ulong, 0644,
+unsigned int libcfs_console_max_delay;
+CFS_MODULE_PARM(libcfs_console_max_delay, "l", uint, 0644,
"Lustre kernel debug console max delay (jiffies)");
EXPORT_SYMBOL(libcfs_console_max_delay);
-cfs_duration_t libcfs_console_min_delay;
-CFS_MODULE_PARM(libcfs_console_min_delay, "l", ulong, 0644,
+unsigned int libcfs_console_min_delay;
+CFS_MODULE_PARM(libcfs_console_min_delay, "l", uint, 0644,
"Lustre kernel debug console min delay (jiffies)");
EXPORT_SYMBOL(libcfs_console_min_delay);
unsigned int libcfs_debug_binary = 1;
EXPORT_SYMBOL(libcfs_debug_binary);
-unsigned int libcfs_stack;
+unsigned int libcfs_stack = 3 * THREAD_SIZE / 4;
EXPORT_SYMBOL(libcfs_stack);
unsigned int portal_enter_debugger;
return "lov";
case S_LQUOTA:
return "lquota";
+ case S_OSD:
+ return "osd";
+ case S_LFSCK:
+ return "lfsck";
case S_LMV:
return "lmv";
case S_SEC:
return "quota";
case D_SEC:
return "sec";
- }
+ case D_LFSCK:
+ return "lfsck";
+ }
}
int
if ((t = sscanf(str, "%i%n", &m, &matched)) >= 1 &&
matched == n) {
+ /* don't print warning for lctl set_param debug=0 or -1 */
+ if (m != 0 && m != -1)
+ CWARN("You are trying to use a numerical value for the "
+ "mask - this will be deprecated in a future "
+ "release.\n");
*mask = m;
return 0;
}
- return libcfs_str2mask(str, fn, mask, is_subsys ? 0 : D_CANTMASK,
- 0xffffffff);
+ return cfs_str2mask(str, fn, mask, is_subsys ? 0 : D_CANTMASK,
+ 0xffffffff);
}
/**
/* we're being careful to ensure that the kernel thread is
* able to set our state to running as it exits before we
* get to schedule() */
- cfs_waitlink_init(&wait);
- cfs_set_current_state(CFS_TASK_INTERRUPTIBLE);
- cfs_waitq_add(&debug_ctlwq, &wait);
-
- dumper = cfs_kthread_run(libcfs_debug_dumplog_thread,
- (void*)(long)cfs_curproc_pid(),
- "libcfs_debug_dumper");
- if (IS_ERR(dumper))
- printk(CFS_KERN_ERR "LustreError: cannot start log dump thread:"
- " %ld\n", PTR_ERR(dumper));
+ cfs_waitlink_init(&wait);
+ cfs_set_current_state(CFS_TASK_INTERRUPTIBLE);
+ cfs_waitq_add(&debug_ctlwq, &wait);
+
+ dumper = kthread_run(libcfs_debug_dumplog_thread,
+ (void *)(long)cfs_curproc_pid(),
+ "libcfs_debug_dumper");
+ if (IS_ERR(dumper))
+ printk(CFS_KERN_ERR "LustreError: cannot start log dump thread:"
+ " %ld\n", PTR_ERR(dumper));
else
cfs_waitq_wait(&wait, CFS_TASK_INTERRUPTIBLE);
- /* be sure to teardown if cfs_kernel_thread() failed */
+ /* be sure to teardown if cfs_create_thread() failed */
cfs_waitq_del(&debug_ctlwq, &wait);
cfs_set_current_state(CFS_TASK_RUNNING);
}
+EXPORT_SYMBOL(libcfs_debug_dumplog);
int libcfs_debug_init(unsigned long bufsize)
{
libcfs_debug = debug_level;
}
-EXPORT_SYMBOL(libcfs_debug_dumplog);
EXPORT_SYMBOL(libcfs_debug_set_level);
+
+long libcfs_log_return(struct libcfs_debug_msg_data *msgdata, long rc)
+{
+ libcfs_debug_msg(msgdata, "Process leaving (rc=%lu : %ld : %lx)\n",
+ rc, rc, rc);
+ return rc;
+}
+EXPORT_SYMBOL(libcfs_log_return);
+
+void libcfs_log_goto(struct libcfs_debug_msg_data *msgdata, const char *label,
+ long_ptr_t rc)
+{
+ libcfs_debug_msg(msgdata, "Process leaving via %s (rc=" LPLU " : " LPLD
+ " : " LPLX ")\n", label, (ulong_ptr_t)rc, rc, rc);
+}
+EXPORT_SYMBOL(libcfs_log_goto);