mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
debug: move all of the debug bits out of the spl
Pull all of the internal debug infrastructure up in to the zfs code to clean up the layering. Remove all the dodgy usage of SET_ERROR and DTRACE_PROBE from the spl. Luckily it was lightly used in the spl layer so we're not losing much. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #17861
This commit is contained in:
@@ -3,4 +3,5 @@ libzpool_sys_HEADERS = \
|
||||
%D%/sys/abd_os.h \
|
||||
%D%/sys/abd_impl_os.h \
|
||||
%D%/sys/trace_zfs.h \
|
||||
%D%/sys/zfs_context_os.h
|
||||
%D%/sys/zfs_context_os.h \
|
||||
%D%/sys/zfs_debug_os.h
|
||||
|
||||
@@ -1,24 +1 @@
|
||||
/* Here to keep the libspl build happy */
|
||||
|
||||
#ifndef _LIBSPL_ZFS_TRACE_H
|
||||
#define _LIBSPL_ZFS_TRACE_H
|
||||
|
||||
/*
|
||||
* The set-error SDT probe is extra static, in that we declare its fake
|
||||
* function literally, rather than with the DTRACE_PROBE1() macro. This is
|
||||
* necessary so that SET_ERROR() can evaluate to a value, which wouldn't
|
||||
* be possible if it required multiple statements (to declare the function
|
||||
* and then call it).
|
||||
*
|
||||
* SET_ERROR() uses the comma operator so that it can be used without much
|
||||
* additional code. For example, "return (EINVAL);" becomes
|
||||
* "return (SET_ERROR(EINVAL));". Note that the argument will be evaluated
|
||||
* twice, so it should not have side effects (e.g. something like:
|
||||
* "return (SET_ERROR(log_error(EINVAL, info)));" would log the error twice).
|
||||
*/
|
||||
#undef SET_ERROR
|
||||
#define SET_ERROR(err) \
|
||||
(__set_error(__FILE__, __func__, __LINE__, err), err)
|
||||
|
||||
|
||||
#endif
|
||||
/* keep me */
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: CDDL-1.0
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or https://opensource.org/licenses/CDDL-1.0.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
#ifndef _SYS_ZFS_DEBUG_OS_H
|
||||
#define _SYS_ZFS_DEBUG_OS_H
|
||||
|
||||
#define SET_ERROR(err) \
|
||||
(__set_error(__FILE__, __func__, __LINE__, err), err)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user