[Sheepdog] [PATCH 2/2] sheep: unify nodeid format in debug info

Liu Yuan namei.unix at gmail.com
Fri Sep 16 05:35:24 CEST 2011


From: Liu Yuan <tailai.ly at taobao.com>

Some are in decimal, cause much inconvenience. So unify them into hex.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index d968c79..ee12cf3 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -981,7 +981,7 @@ static void sd_deliver(cpg_handle_t handle, const struct cpg_name *group_name,
 	struct message_header *m = msg;
 	char name[128];
 
-	dprintf("op: %d, state: %u, size: %d, from: %s, nodeid: %u, pid: %u\n",
+	dprintf("op: %d, state: %u, size: %d, from: %s, nodeid: %x, pid: %u\n",
 		m->op, m->state, m->msg_length,
 		addr_to_str(name, sizeof(name), m->from.addr, m->from.port),
 		nodeid, pid);
@@ -1165,7 +1165,7 @@ static void send_join_request(struct cpg_address *addr, struct work_confchg *w)
 
 	send_message(sys->handle, (struct message_header *)&msg);
 
-	vprintf(SDOG_INFO "%u %u\n", sys->this_nodeid, sys->this_pid);
+	vprintf(SDOG_INFO "%x %u\n", sys->this_nodeid, sys->this_pid);
 }
 
 static void __sd_confchg_done(struct cpg_event *cevent)
@@ -1622,7 +1622,7 @@ static void sd_confchg(cpg_handle_t handle, const struct cpg_name *group_name,
 	dprintf("%zd %zd %zd\n", member_list_entries, left_list_entries,
 		joined_list_entries);
 	for (i = 0; i < member_list_entries; i++) {
-		dprintf("[%d] node_id: %d, pid: %d, reason: %d\n", i,
+		dprintf("[%x] node_id: %x, pid: %d, reason: %d\n", i,
 			member_list[i].nodeid, member_list[i].pid,
 			member_list[i].reason);
 	}
-- 
1.7.5.1




More information about the sheepdog mailing list