From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/daemon app.c cpg.c gd_internal.h ...
Date: 26 Sep 2006 21:32:39 -0000 [thread overview]
Message-ID: <20060926213239.28521.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-09-26 21:32:38
Modified files:
group/daemon : app.c cpg.c gd_internal.h main.c
Log message:
Adding -vv to the groupd command line will result in a log_debug
for every cpg send and every cpg recv.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cpg.c.diff?cvsroot=cluster&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&r1=1.41&r2=1.42
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&r1=1.45&r2=1.46
--- cluster/group/daemon/app.c 2006/09/26 19:17:20 1.46
+++ cluster/group/daemon/app.c 2006/09/26 21:32:38 1.47
@@ -693,7 +693,7 @@
log_group(g, "send stopped");
g->app->sent_event_id = ev->id;
- return send_message_groupd(g, &msg, sizeof(msg));
+ return send_message_groupd(g, &msg, sizeof(msg), MSG_APP_STOPPED);
}
static int send_started(group_t *g)
@@ -712,7 +712,7 @@
log_group(g, "send started");
g->app->sent_event_id = ev->id;
- return send_message_groupd(g, &msg, sizeof(msg));
+ return send_message_groupd(g, &msg, sizeof(msg), MSG_APP_STARTED);
}
int do_stopdone(char *name, int level)
--- cluster/group/daemon/cpg.c 2006/09/26 19:17:20 1.32
+++ cluster/group/daemon/cpg.c 2006/09/26 21:32:38 1.33
@@ -226,8 +226,15 @@
memcpy(&name, &msg->ms_name, MAX_NAMELEN);
g = find_group_level(name, msg->ms_level);
- if (!g)
+ if (!g) {
+ if (groupd_debug_verbose > 1) {
+ log_print("%d:%s RECV len %d %s from %d, "
+ "no group",
+ msg->ms_level, name, data_len,
+ msg_type(msg->ms_type), nodeid);
+ }
return;
+ }
} else {
g = find_group_by_handle(handle);
if (!g) {
@@ -242,10 +249,9 @@
}
}
- /*
- log_group(g, "deliver_cb from %d len %d type %s", nodeid, data_len,
- msg_type(msg->ms_type));
- */
+ if (groupd_debug_verbose > 1)
+ log_group(g, "RECV len %d %s from %d", data_len,
+ msg_type(msg->ms_type), nodeid);
if (nodeid == our_nodeid && g->app->sent_event_id == msg->ms_event_id)
g->app->sent_event_id = 0;
@@ -557,8 +563,11 @@
return 0;
}
-int send_message_groupd(group_t *g, void *buf, int len)
+int send_message_groupd(group_t *g, void *buf, int len, int type)
{
+ if (groupd_debug_verbose > 1)
+ log_group(g, "SEND len %d %s", len, msg_type(type));
+
return _send_message(groupd_handle, g, buf, len);
}
--- cluster/group/daemon/gd_internal.h 2006/09/26 19:17:21 1.41
+++ cluster/group/daemon/gd_internal.h 2006/09/26 21:32:38 1.42
@@ -51,6 +51,7 @@
extern char *prog_name;
extern int groupd_debug_opt;
+extern int groupd_debug_verbose;
extern char groupd_debug_buf[256];
extern char dump_buf[DUMP_SIZE];
extern int dump_point;
@@ -276,7 +277,7 @@
int do_cpg_join(group_t *g);
int do_cpg_leave(group_t *g);
int send_message(group_t *g, void *buf, int len);
-int send_message_groupd(group_t *g, void *buf, int len);
+int send_message_groupd(group_t *g, void *buf, int len, int type);
void copy_groupd_data(group_data_t *data);
int in_groupd_cpg(int nodeid);
--- cluster/group/daemon/main.c 2006/09/26 19:17:21 1.45
+++ cluster/group/daemon/main.c 2006/09/26 21:32:38 1.46
@@ -12,7 +12,7 @@
#include "gd_internal.h"
-#define OPTION_STRING "DhV"
+#define OPTION_STRING "DhVv"
#define LOCKFILE_NAME "/var/run/groupd.pid"
extern struct list_head recovery_sets;
@@ -598,7 +598,7 @@
act = get_action(buf);
- log_debug("got %d bytes from client %d %s", rv, ci, last_action);
+ log_debug("got client %d %s", ci, last_action);
switch (act) {
@@ -850,6 +850,10 @@
exit(EXIT_SUCCESS);
break;
+ case 'v':
+ groupd_debug_verbose++;
+ break;
+
case 'V':
printf("groupd (built %s %s)\n", __DATE__, __TIME__);
/* printf("%s\n", REDHAT_COPYRIGHT); */
@@ -934,6 +938,7 @@
char *prog_name;
int groupd_debug_opt;
+int groupd_debug_verbose;
char groupd_debug_buf[256];
char dump_buf[DUMP_SIZE];
int dump_point;
next reply other threads:[~2006-09-26 21:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-26 21:32 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-10-06 16:55 [Cluster-devel] cluster/group/daemon app.c cpg.c gd_internal.h teigland
2006-09-26 19:17 teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060926213239.28521.qmail@sourceware.org \
--to=teigland@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.