aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Yao <[email protected]>2015-11-25 10:39:57 -0500
committerBrian Behlendorf <[email protected]>2015-12-02 17:16:41 -0800
commitb22e2797970b44e6b9d1e4624a5ede935c851010 (patch)
treea5f8c8189364ef6c8bdded6c40746d60995e1fba
parenta179a3aa35125e1e98ad0e92527c0cf9e3038fac (diff)
Only trigger SET_ERROR tracepoint event on error
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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #4043
-rw-r--r--include/sys/trace_dbgmsg.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/sys/trace_dbgmsg.h b/include/sys/trace_dbgmsg.h
index e493a4580..314ddeb19 100644
--- a/include/sys/trace_dbgmsg.h
+++ b/include/sys/trace_dbgmsg.h
@@ -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);