Commit a7d5441a authored by Shane Snyder's avatar Shane Snyder
Browse files

update ssg debug output format

parent 54acab18
......@@ -397,7 +397,7 @@ static hg_return_t ssg_lookup(ssg_t s, char **addr_strs)
for (int i = 1; i < s->view.group_size; i++) {
int r = (s->view.self_rank + i) % s->view.group_size;
#if 1
int aret = ABT_thread_create(*margo_get_handler_pool(s->mid), &lookup_ult,
aret = ABT_thread_create(*margo_get_handler_pool(s->mid), &lookup_ult,
&args[r], ABT_THREAD_ATTR_NULL, &ults[r]);
if (aret != ABT_SUCCESS) {
hret = HG_OTHER_ERROR;
......
......@@ -139,7 +139,7 @@ static int swim_send_dping(
if(hret != HG_SUCCESS)
return(ret);
SSG_DEBUG(s, "send dping req to %d\n", (int)target);
SSG_DEBUG(s, "SWIM: send dping req to %d\n", (int)target);
/* fill the direct ping request with current membership state */
swim_pack_message(s, &(dping_req.msg));
......@@ -153,7 +153,7 @@ static int swim_send_dping(
if(hret != HG_SUCCESS)
return(ret);
SSG_DEBUG(s, "recv dping ack from %d\n", (int)dping_resp.msg.source_id);
SSG_DEBUG(s, "SWIM: recv dping ack from %d\n", (int)dping_resp.msg.source_id);
assert(dping_resp.msg.source_id == target);
/* extract target's membership state from response */
......@@ -163,7 +163,7 @@ static int swim_send_dping(
}
else if(hret != HG_TIMEOUT)
{
SSG_DEBUG(s, "dping req error from %d, err=%d\n", (int)target, hret);
SSG_DEBUG(s, "SWIM: dping req error from %d (err=%d)\n", (int)target, hret);
}
HG_Destroy(handle);
......@@ -201,7 +201,7 @@ static void swim_dping_recv_ult(hg_handle_t handle)
if(hret != HG_SUCCESS)
return;
SSG_DEBUG(s, "recv dping req from %d\n", (int)dping_req.msg.source_id);
SSG_DEBUG(s, "SWIM: recv dping req from %d\n", (int)dping_req.msg.source_id);
/* extract sender's membership state from request */
swim_unpack_message(s, &(dping_req.msg));
......@@ -209,7 +209,7 @@ static void swim_dping_recv_ult(hg_handle_t handle)
/* fill the direct ping response with current membership state */
swim_pack_message(s, &(dping_resp.msg));
SSG_DEBUG(s, "send dping ack to %d\n", (int)dping_req.msg.source_id);
SSG_DEBUG(s, "SWIM: send dping ack to %d\n", (int)dping_req.msg.source_id);
/* respond to sender of the dping req */
margo_respond(s->mid, handle, &dping_resp);
......@@ -260,7 +260,7 @@ void swim_iping_send_ult(
if(hret != HG_SUCCESS)
return;
SSG_DEBUG(s, "send iping req to %d, target=%d\n",
SSG_DEBUG(s, "SWIM: send iping req to %d (target=%d)\n",
(int)my_subgroup_member, (int)swim_ctx->ping_target);
/* fill the indirect ping request with target member and current
......@@ -282,7 +282,7 @@ void swim_iping_send_ult(
if(hret != HG_SUCCESS)
return;
SSG_DEBUG(s, "recv iping ack from %d, target=%d\n",
SSG_DEBUG(s, "SWIM: recv iping ack from %d (target=%d)\n",
(int)iping_resp.msg.source_id, (int)swim_ctx->ping_target);
/* extract target's membership state from response */
......@@ -297,7 +297,7 @@ void swim_iping_send_ult(
}
else if(hret != HG_TIMEOUT)
{
SSG_DEBUG(s, "iping req error from %d, err=%d, target=%d\n",
SSG_DEBUG(s, "SWIM: iping req error from %d (target=%d, err=%d)\n",
(int)my_subgroup_member, hret, (int)swim_ctx->ping_target);
}
......@@ -335,7 +335,7 @@ static void swim_iping_recv_ult(hg_handle_t handle)
if(hret != HG_SUCCESS)
return;
SSG_DEBUG(s, "recv iping req from %d, target=%d\n",
SSG_DEBUG(s, "SWIM: recv iping req from %d (target=%d)\n",
(int)iping_req.msg.source_id, (int)iping_req.target_id);
/* extract sender's membership state from request */
......@@ -350,7 +350,7 @@ static void swim_iping_recv_ult(hg_handle_t handle)
*/
swim_pack_message(s, &(iping_resp.msg));
SSG_DEBUG(s, "send iping ack to %d, target=%d\n",
SSG_DEBUG(s, "SWIM: send iping ack to %d (target=%d)\n",
(int)iping_req.msg.source_id, (int)iping_req.target_id);
/* respond to sender of the iping req */
......
......@@ -117,7 +117,9 @@ static void swim_prot_ult(
assert(s != SSG_NULL);
SSG_DEBUG(s, "swim protocol start\n");
SSG_DEBUG(s, "SWIM: protocol start (period_len=%.4f, susp_timeout=%d, subgroup_size=%d)\n",
s->swim_ctx->prot_period_len, s->swim_ctx->prot_susp_timeout,
s->swim_ctx->prot_subgroup_sz);
while(!(s->swim_ctx->shutdown_flag))
{
/* spawn a ULT to run this tick */
......@@ -131,7 +133,7 @@ static void swim_prot_ult(
/* sleep for a protocol period length */
margo_thread_sleep(s->mid, s->swim_ctx->prot_period_len);
}
SSG_DEBUG(s, "swim protocol shutdown\n");
SSG_DEBUG(s, "SWIM: protocol shutdown\n");
return;
}
......@@ -166,7 +168,7 @@ static void swim_tick_ult(
if(swim_get_rand_group_member(s, &(swim_ctx->ping_target)) == 0)
{
/* no available members, back out */
SSG_DEBUG(s, "no group members available to dping\n");
SSG_DEBUG(s, "SWIM: no group members available to dping\n");
return;
}
......@@ -199,7 +201,7 @@ static void swim_tick_ult(
if(this_subgroup_sz == 0)
{
/* no available subgroup members, back out */
SSG_DEBUG(s, "no subgroup members available to iping\n");
SSG_DEBUG(s, "SWIM: no subgroup members available to iping\n");
return;
}
......@@ -313,7 +315,7 @@ void swim_apply_membership_updates(
if(updates[i].inc_nr == swim_ctx->member_inc_nrs[self_id])
{
swim_ctx->member_inc_nrs[self_id]++;
SSG_DEBUG(s, "self SUSPECT received, new inc_nr is %d\n",
SSG_DEBUG(s, "SWIM: self SUSPECT received (new inc_nr=%d)\n",
swim_ctx->member_inc_nrs[self_id]);
}
}
......@@ -329,7 +331,7 @@ void swim_apply_membership_updates(
assert(updates[i].inc_nr <= swim_ctx->member_inc_nrs[self_id]);
swim_ctx->member_inc_nrs[self_id] = updates[i].inc_nr;
SSG_DEBUG(s, "self confirmed DEAD in inc_nr %d\n",
SSG_DEBUG(s, "SWIM: self confirmed DEAD (inc_nr=%d)\n",
swim_ctx->member_inc_nrs[self_id]);
swim_finalize(swim_ctx);
......@@ -340,7 +342,7 @@ void swim_apply_membership_updates(
}
break;
default:
SSG_DEBUG(s, "Cannot apply membership update (invalid status)\n");
SSG_DEBUG(s, "SWIM: invalid membership status update\n");
}
}
......@@ -398,7 +400,7 @@ static void swim_suspect_member(
return;
}
SSG_DEBUG(s, "swim member %d SUSPECT (inc_nr=%d)\n",
SSG_DEBUG(s, "SWIM: member %d SUSPECT (inc_nr=%d)\n",
(int)member_id, (int)inc_nr);
if(suspect_link == NULL)
......@@ -447,7 +449,7 @@ static void swim_unsuspect_member(
if(inc_nr <= swim_ctx->member_inc_nrs[member_id])
return;
SSG_DEBUG(s, "swim member %d ALIVE (inc_nr=%d)\n",
SSG_DEBUG(s, "SWIM: member %d ALIVE (inc_nr=%d)\n",
(int)member_id, (int)inc_nr);
/* if member is suspected, remove from suspect list */
......@@ -488,7 +490,7 @@ static void swim_kill_member(
if(!(s->view.member_states[member_id].is_member))
return;
SSG_DEBUG(s, "swim member %d DEAD (inc_nr=%d)\n",
SSG_DEBUG(s, "SWIM: member %d DEAD (inc_nr=%d)\n",
(int)member_id, (int)inc_nr);
LL_FOREACH_SAFE(*suspect_list_p, iter, tmp)
......
......@@ -15,11 +15,11 @@ swim_log = sys.argv[1]
member_info = {}
# ssg debug output looks like "timestamp <member>"
swim_dbg_pattern = re.compile('^\d+.\d+ <\d+>')
ssg_dbg_pattern = re.compile('^\d+.\d+ <\d+>')
with open(swim_log, 'rU') as f:
for line in f:
if not swim_dbg_pattern.match(line):
if not ssg_dbg_pattern.match(line):
continue
fields = line.split(" ")
......@@ -27,12 +27,10 @@ with open(swim_log, 'rU') as f:
member = int(fields[1][1:-2])
update = fields[2:]
# FIXME
if update[0] == "group" and update[1] == "lookup" and update[2] == "successful":
if " ".join(update[0:3]) == "group lookup successful":
group_size = update[3][6:-2]
# FIXME
if update[0] != "swim" or update[1] != "member":
if update[0] != "SWIM:" or update[1] != "member":
continue
target_member = int(update[2])
target_member_status = update[3]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment