]> granicus.if.org Git - zfs/commitdiff
Only trigger SET_ERROR tracepoint event on error
authorRichard Yao <richard.yao@clusterhq.com>
Wed, 25 Nov 2015 15:39:57 +0000 (10:39 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 3 Dec 2015 01:16:41 +0000 (17:16 -0800)
Currently, the SET_ERROR tracepoint triggers regardless of whether there
is an error or not. On Illumos, SET_ERROR only triggers on an actual
error, which is avoids irrelevant noise. Linux 2.6.38 added support for
conditional tracepoints, so we modify SET_ERROR to use them when they
are avaliable for functionality equivalent to the Illumos functionality.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4043

include/sys/trace_dbgmsg.h

index e493a45802ed8cb8646e0e51b6e384c8a9d608d3..314ddeb19adbecf34915e733f4a8f262b3a5918b 100644 (file)
@@ -103,9 +103,18 @@ DECLARE_EVENT_CLASS(zfs_set_error_class,
            __entry->function, __entry->error)
 );
 
+#ifdef TP_CONDITION
+#define        DEFINE_SET_ERROR_EVENT(name) \
+DEFINE_EVENT_CONDITION(zfs_set_error_class, name, \
+       TP_PROTO(const char *file, const char *function, int line, \
+           uintptr_t error), \
+       TP_ARGS(file, function, line, error), \
+       TP_CONDITION(error))
+#else
 #define        DEFINE_SET_ERROR_EVENT(name) \
 DEFINE_EVENT(zfs_set_error_class, name, \
        TP_PROTO(const char *file, const char *function, int line, \
            uintptr_t error), \
        TP_ARGS(file, function, line, error))
+#endif
 DEFINE_SET_ERROR_EVENT(zfs_set__error);