Skip to content

Commit

Permalink
Only trigger SET_ERROR tracepoint event on error
Browse files Browse the repository at this point in the history
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 openzfs#4043
  • Loading branch information
ryao authored and behlendorf committed Dec 3, 2015
1 parent a179a3a commit b22e279
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/sys/trace_dbgmsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit b22e279

Please sign in to comment.