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