"Logging specific to MC (request)");
static char* pointer_to_string(void* pointer);
+static char* buff_size_to_string(size_t size);
-int MC_request_depend(smx_req_t r1, smx_req_t r2)
+int MC_request_depend(smx_simcall_t r1, smx_simcall_t r2)
{
if(_surf_do_model_check == 2)
return TRUE;
+
if (r1->issuer == r2->issuer)
return FALSE;
&& r2->comm_wait.comm->comm.dst_buff != r1->comm_test.comm->comm.src_buff)
return FALSE;
+
return TRUE;
}
return xbt_strdup("(verbose only)");
}
-char *MC_request_to_string(smx_req_t req, int value)
+static char* buff_size_to_string(size_t buff_size) {
+
+ if (XBT_LOG_ISENABLED(mc_request, xbt_log_priority_verbose))
+ return bprintf("%zu", buff_size);
+
+ return xbt_strdup("(verbose only)");
+}
+
+
+char *MC_request_to_string(smx_simcall_t req, int value)
{
- char *type = NULL, *args = NULL, *str = NULL, *p = NULL;
+ char *type = NULL, *args = NULL, *str = NULL, *p = NULL, *bs = NULL;
smx_action_t act = NULL;
size_t size = 0;
case REQ_COMM_ISEND:
type = xbt_strdup("iSend");
p = pointer_to_string(req->comm_isend.src_buff);
- args = bprintf("src=%s, buff=%s, size=%zu", req->issuer->name,
- p, req->comm_isend.src_buff_size);
+ bs = buff_size_to_string(req->comm_isend.src_buff_size);
+ args = bprintf("src=%s, buff=%s, size=%s", req->issuer->name, p, bs);
break;
case REQ_COMM_IRECV:
size = req->comm_irecv.dst_buff_size ? *req->comm_irecv.dst_buff_size : 0;
type = xbt_strdup("iRecv");
p = pointer_to_string(req->comm_irecv.dst_buff);
- args = bprintf("dst=%s, buff=%s, size=%zu", req->issuer->name,
- p, size);
+ bs = buff_size_to_string(size);
+ args = bprintf("dst=%s, buff=%s, size=%s", req->issuer->name, p, bs);
break;
case REQ_COMM_WAIT:
act = req->comm_wait.comm;
break;
case REQ_COMM_TEST:
act = req->comm_test.comm;
- if(act->comm.src_proc == NULL || act->comm.src_proc == NULL){
+ if(act->comm.src_proc == NULL || act->comm.dst_proc == NULL){
type = xbt_strdup("Test FALSE");
p = pointer_to_string(act);
args = bprintf("comm=%s", p);
type = xbt_strdup("Test TRUE");
p = pointer_to_string(act);
args = bprintf("comm=%s [(%lu)%s -> (%lu)%s]", p,
- act->comm.src_proc ? act->comm.src_proc->pid : 0,
- act->comm.src_proc ? act->comm.src_proc->name : "",
- act->comm.dst_proc ? act->comm.dst_proc->pid : 0,
- act->comm.dst_proc ? act->comm.dst_proc->name : "");
+ act->comm.src_proc->pid, act->comm.src_proc->name,
+ act->comm.dst_proc->pid, act->comm.dst_proc->name);
}
break;
xbt_free(type);
xbt_free(args);
xbt_free(p);
+ xbt_free(bs);
return str;
}
-unsigned int MC_request_testany_fail(smx_req_t req)
+unsigned int MC_request_testany_fail(smx_simcall_t req)
{
unsigned int cursor;
smx_action_t action;
return TRUE;
}
-int MC_request_is_visible(smx_req_t req)
+int MC_request_is_visible(smx_simcall_t req)
{
return req->call == REQ_COMM_ISEND
|| req->call == REQ_COMM_IRECV
|| req->call == REQ_COMM_TESTANY;
}
-int MC_request_is_enabled(smx_req_t req)
+int MC_request_is_enabled(smx_simcall_t req)
{
unsigned int index = 0;
smx_action_t act;
}
}
-int MC_request_is_enabled_by_idx(smx_req_t req, unsigned int idx)
+int MC_request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
{
smx_action_t act;
int MC_process_is_enabled(smx_process_t process)
{
- if (process->request.call != REQ_NO_REQ && MC_request_is_enabled(&process->request))
+ if (process->simcall.call != REQ_NO_REQ && MC_request_is_enabled(&process->simcall))
return TRUE;
return FALSE;