mask, &cdls, format, ## __VA_ARGS__); \
} while (0)
+# define CDEBUG_SLOW(delay, mask, format, ...) \
+do { \
+ static struct cfs_debug_limit_state cdls = { \
+ .cdls_count = -delay, \
+ .cdls_delay = delay, \
+ }; \
+ \
+ __CDEBUG_WITH_LOC(__FILE__, __func__, __LINE__, \
+ mask, &cdls, format, ## __VA_ARGS__); \
+} while (0)
# else /* !CDEBUG_ENABLED */
static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem)
{
# define CDEBUG(mask, format, ...) (void)(0)
# define CDEBUG_LIMIT(mask, format, ...) (void)(0)
# define CDEBUG_LIMIT_LOC(file, func, line, mask, format, ...) (void)(0)
+# define CDEBUG_SLOW(delay, mask, format, ...) (void)(0)
# warning "CDEBUG IS DISABLED. THIS SHOULD NEVER BE DONE FOR PRODUCTION!"
# endif /* CDEBUG_ENABLED */
#define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
#define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__)
+#define CWARN_SLOW(delay, format, ...) CDEBUG_SLOW(delay, D_WARNING, format, \
+ ## __VA_ARGS__)
+#define CERROR_SLOW(delay, format, ...) CDEBUG_SLOW(delay, D_ERROR, format, \
+ ## __VA_ARGS__)
+
#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
#define LCONSOLE_INFO(format, ...) CDEBUG_LIMIT(D_CONSOLE, format, ## __VA_ARGS__)
#define LCONSOLE_WARN(format, ...) CDEBUG_LIMIT(D_CONSOLE | D_WARNING, format, ## __VA_ARGS__)
}
if (cdls != NULL) {
+ /* avoid unlikely case of many errors between printing */
+ if (unlikely(cdls->cdls_count < 0 &&
+ cdls->cdls_count >= -600)) {
+ cdls->cdls_next = jiffies +
+ cfs_time_seconds(-cdls->cdls_count);
+ cdls->cdls_count = 1;
+ }
if (libcfs_console_ratelimit &&
cdls->cdls_next != 0 && /* not first time ever */
time_before(jiffies, cdls->cdls_next)) {
cfs_print_to_console(&header, file, fn,
"Skipped %d previous similar message%s\n",
cdls->cdls_count,
- (cdls->cdls_count > 1) ? "s" : "");
-
+ cdls->cdls_count > 1 ? "s" : "");
cdls->cdls_count = 0;
}
out:
target = class_str2obd(str);
if (!target) {
deuuidify(str, NULL, &target_start, &target_len);
- LCONSOLE_ERROR("%.*s: not available for connect from %s (no target). If you are running an HA pair check that the target is mounted on the other server.\n",
- target_len, target_start,
- libcfs_nidstr(&req->rq_peer.nid));
+ CERROR_SLOW(5,
+ "%.*s: not available for connect from %s (no target). If you are running an HA pair check that the target is mounted on the other server.\n",
+ target_len, target_start,
+ libcfs_nidstr(&req->rq_peer.nid));
GOTO(out, rc = -ENODEV);
}
if (ptlrpc_console_allow(req, opc,
lustre_msg_get_status(req->rq_reqmsg)))
debug_mask = D_WARNING;
+ /* this message is used in replay-single test_200, DO NOT MODIFY */
DEBUG_REQ(debug_mask, req, "Request sent has %s: [sent %lld/real %lld]",
req->rq_net_err ? "failed due to network error" :
((req->rq_real_sent == 0 ||