]>
git.proxmox.com Git - mirror_zfs.git/blob - module/zfs/zfs_debug.c
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.
25 #include <sys/zfs_context.h>
28 * Enable various debugging features.
33 * zfs_recover can be set to nonzero to attempt to recover from
34 * otherwise-fatal errors, typically caused by on-disk corruption. When
35 * set, calls to zfs_panic_recover() will turn into warning messages.
41 zfs_panic_recover(const char *fmt
, ...)
46 vcmn_err(zfs_recover
? CE_WARN
: CE_PANIC
, fmt
, adx
);
51 * Debug logging is enabled by default for production kernel builds.
52 * The overhead for this is negligible and the logs can be valuable when
53 * debugging. For non-production user space builds all debugging except
54 * logging is enabled since performance is no longer a concern.
61 zfs_flags
= ZFS_DEBUG_DPRINTF
;
62 spl_debug_set_mask(spl_debug_get_mask() | SD_DPRINTF
);
63 spl_debug_set_subsys(spl_debug_get_subsys() | SS_USER1
);
65 zfs_flags
= ~ZFS_DEBUG_DPRINTF
;
78 module_param(zfs_flags
, int, 0644);
79 MODULE_PARM_DESC(zfs_flags
, "Set additional debugging flags");
81 module_param(zfs_recover
, int, 0644);
82 MODULE_PARM_DESC(zfs_recover
, "Set to attempt to recover from fatal errors");