Date: Tue, 16 Sep 2014 03:03:51 +0100 From: "Steven Hartland" <smh@freebsd.org> To: <freebsd-dtrace@freebsd.org> Cc: hackers@freebsd.org Subject: ZFS SET_ERROR dtrace probe possible under FreeBSD? Message-ID: <AEC968EBE6DE4E56A76DD7578DC25483@multiplay.co.uk>
index | next in thread | raw e-mail
The following commit added SET_ERROR dtrace probes to illumos https://github.com/illumos/illumos-gate/commit/be6fd75 Now we have all the SET_ERROR calls but the FreeBSD's ZFS implementation but our SET_ERROR in sys/cddl/compat/opensolaris/sys/sdt.h is simply: #define SET_ERROR(err) (err) I tried using the illumos version but that resulted being unable to mount ZFS root, so clearly not right. /* * 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). */ extern void __dtrace_probe_set__error(uintptr_t); #define SET_ERROR(err) (__dtrace_probe_set__error(err), err) For those that know the the ins and outs of our dtrace is it possible for us to add support for this trace point? Regards Stevehome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AEC968EBE6DE4E56A76DD7578DC25483>
