Date: Wed, 19 Jun 2024 20:58:10 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: e5a7890dc00a - main - zfs: Use a statement expression to implement SET_ERROR() Message-ID: <202406192058.45JKwAe7036273@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e5a7890dc00ac0b158498db92008f7c0b5970eac commit e5a7890dc00ac0b158498db92008f7c0b5970eac Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-06-19 16:01:54 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-06-19 20:57:30 +0000 zfs: Use a statement expression to implement SET_ERROR() This way we can avoid making assumptions about the SDT probe implementation. No functional change intended. This was submitted upstream as https://github.com/openzfs/zfs/pull/16284 MFC after: 1 week --- sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h b/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h index 2daa6de1af08..74e03fd5b956 100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/sdt.h @@ -31,13 +31,14 @@ #include_next <sys/sdt.h> #ifdef KDTRACE_HOOKS -/* CSTYLED */ +/* BEGIN CSTYLED */ SDT_PROBE_DECLARE(sdt, , , set__error); -#define SET_ERROR(err) \ - ((sdt_sdt___set__error->id ? \ - (*sdt_probe_func)(sdt_sdt___set__error->id, \ - (uintptr_t)err, 0, 0, 0, 0) : 0), err) +#define SET_ERROR(err) ({ \ + SDT_PROBE1(sdt, , , set__error, (uintptr_t)err); \ + err; \ +}) +/* END CSTYLED */ #else #define SET_ERROR(err) (err) #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406192058.45JKwAe7036273>