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 <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4043
This commit is contained in:
Richard Yao 2015-11-25 10:39:57 -05:00 committed by Brian Behlendorf
parent a179a3aa35
commit b22e279797

View 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);