4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2012 by Delphix. All rights reserved.
26 #include <sys/zfs_context.h>
29 * Enable various debugging features.
34 * zfs_recover can be set to nonzero to attempt to recover from
35 * otherwise-fatal errors, typically caused by on-disk corruption. When
36 * set, calls to zfs_panic_recover() will turn into warning messages.
42 zfs_panic_recover(const char *fmt, ...)
47 vcmn_err(zfs_recover ? CE_WARN : CE_PANIC, fmt, adx);
52 * Debug logging is enabled by default for production kernel builds.
53 * The overhead for this is negligible and the logs can be valuable when
54 * debugging. For non-production user space builds all debugging except
55 * logging is enabled since performance is no longer a concern.
62 zfs_flags = ZFS_DEBUG_DPRINTF;
63 spl_debug_set_mask(spl_debug_get_mask() | SD_DPRINTF);
64 spl_debug_set_subsys(spl_debug_get_subsys() | SS_USER1);
66 zfs_flags = ~ZFS_DEBUG_DPRINTF;
79 module_param(zfs_flags, int, 0644);
80 MODULE_PARM_DESC(zfs_flags, "Set additional debugging flags");
82 module_param(zfs_recover, int, 0644);
83 MODULE_PARM_DESC(zfs_recover, "Set to attempt to recover from fatal errors");