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:
Brian Behlendorf
2025-10-30 17:23:27 -07:00
parent eceb5b32e9
commit 801d9b4f96
16 changed files with 71 additions and 82 deletions
-1
View File
@@ -69,7 +69,6 @@ libspl_sys_HEADERS = \
%D%/sys/time.h \
%D%/sys/timer.h \
%D%/sys/trace.h \
%D%/sys/trace_spl.h \
%D%/sys/tsd.h \
%D%/sys/tunables.h \
%D%/sys/types.h \
-24
View File
@@ -1,24 +0,0 @@
/* Here to keep the libspl build happy */
#ifndef _LIBSPL_SPL_TRACE_H
#define _LIBSPL_SPL_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