Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9d2... Commit: 9d26aa2f383cfc1864d6cfc7f7d6cf01b3ab17ee Parent: e3a0d33dddf556dc698f31ff6ae0ce2fa66afbd3 Author: David Teigland teigland@redhat.com AuthorDate: Tue Mar 27 15:19:14 2012 -0500 Committer: David Teigland teigland@redhat.com CommitterDate: Tue Mar 27 15:19:14 2012 -0500
dlm_controld: limit repeating log messages
avoid filling the log buffer with the same info during log waits
Signed-off-by: David Teigland teigland@redhat.com --- dlm_controld/cpg.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c index b2f6e3b..83e9b17 100644 --- a/dlm_controld/cpg.c +++ b/dlm_controld/cpg.c @@ -8,6 +8,14 @@
#include "dlm_daemon.h"
+#define log_limit(ls, fmt, args...) ({ \ + static uint32_t __change_nr; \ + if (ls->change_seq > __change_nr) { \ + __change_nr = ls->change_seq; \ + log_group(ls, fmt, ##args); \ + } \ +}) + /* per lockspace cpg: ls->node_history */
struct node { @@ -374,10 +382,11 @@ static int check_ringid_done(struct lockspace *ls) return 0; }
- log_group(ls, "check_ringid done cluster %u cpg %u:%llu", + log_limit(ls, "check_ringid done cluster %u cpg %u:%llu", cluster_ringid_seq, ls->cpg_ringid.nodeid, (unsigned long long)ls->cpg_ringid.seq); - return 1; + + return 1; }
static int check_fencing_done(struct lockspace *ls) @@ -426,7 +435,7 @@ static int check_fencing_done(struct lockspace *ls) }
if (wait_count) { - log_group(ls, "check_fencing wait_count %d", wait_count); + log_limit(ls, "check_fencing wait_count %d", wait_count); return 0; }
@@ -441,7 +450,7 @@ static int check_fencing_done(struct lockspace *ls) }
if (in_progress) { - log_group(ls, "check_fencing in progress %d", in_progress); + log_limit(ls, "check_fencing in progress %d", in_progress); return 0; }
cluster-commits@lists.fedorahosted.org