1*eda14cbcSMatt Macy /* Here to keep the libspl build happy */
2*eda14cbcSMatt Macy 
3*eda14cbcSMatt Macy #ifndef _LIBSPL_ZFS_TRACE_H
4*eda14cbcSMatt Macy #define	_LIBSPL_ZFS_TRACE_H
5*eda14cbcSMatt Macy 
6*eda14cbcSMatt Macy /*
7*eda14cbcSMatt Macy  * The set-error SDT probe is extra static, in that we declare its fake
8*eda14cbcSMatt Macy  * function literally, rather than with the DTRACE_PROBE1() macro.  This is
9*eda14cbcSMatt Macy  * necessary so that SET_ERROR() can evaluate to a value, which wouldn't
10*eda14cbcSMatt Macy  * be possible if it required multiple statements (to declare the function
11*eda14cbcSMatt Macy  * and then call it).
12*eda14cbcSMatt Macy  *
13*eda14cbcSMatt Macy  * SET_ERROR() uses the comma operator so that it can be used without much
14*eda14cbcSMatt Macy  * additional code.  For example, "return (EINVAL);" becomes
15*eda14cbcSMatt Macy  * "return (SET_ERROR(EINVAL));".  Note that the argument will be evaluated
16*eda14cbcSMatt Macy  * twice, so it should not have side effects (e.g. something like:
17*eda14cbcSMatt Macy  * "return (SET_ERROR(log_error(EINVAL, info)));" would log the error twice).
18*eda14cbcSMatt Macy  */
19*eda14cbcSMatt Macy #undef SET_ERROR
20*eda14cbcSMatt Macy #define	SET_ERROR(err) \
21*eda14cbcSMatt Macy 	(__set_error(__FILE__, __func__, __LINE__, err), err)
22*eda14cbcSMatt Macy 
23*eda14cbcSMatt Macy 
24*eda14cbcSMatt Macy #endif
25