Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : MUTEX_UNLOCK is invisible for MC
[simgrid.git] / src / mc / mc_request.c
index af7f1ef..5c7d573 100644 (file)
@@ -231,6 +231,7 @@ char *MC_request_to_string(smx_simcall_t req, int value)
 {
   char *type = NULL, *args = NULL, *str = NULL, *p = NULL, *bs = NULL;
   smx_synchro_t act = NULL;
+  smx_mutex_t mutex = NULL;
   size_t size = 0;
 
   switch (req->call) {
@@ -328,6 +329,12 @@ char *MC_request_to_string(smx_simcall_t req, int value)
     }
     break;
 
+  case SIMCALL_MUTEX_LOCK:
+    mutex = simcall_mutex_lock__get__mutex(req);
+    type = xbt_strdup("Mutex LOCK");
+    args = bprintf("locked = %d, owner = %d, sleeping = %d", mutex->locked, mutex->owner != NULL ? (int)mutex->owner->pid : -1, xbt_swag_size(mutex->sleeping));
+    break;
+
   case SIMCALL_MC_SNAPSHOT:
     type = xbt_strdup("MC_SNAPSHOT");
     args = NULL;
@@ -420,7 +427,7 @@ char *MC_request_get_dot_output(smx_simcall_t req, int value)
 
   char *str = NULL, *label = NULL;
   smx_synchro_t act = NULL;
-
+  
   switch (req->call) {
   case SIMCALL_COMM_ISEND:
     if (req->issuer->smx_host)
@@ -517,6 +524,10 @@ char *MC_request_get_dot_output(smx_simcall_t req, int value)
     }
     break;
 
+  case SIMCALL_MUTEX_LOCK:
+    label = bprintf("[(%lu)] Mutex LOCK", req->issuer->pid);
+    break;
+
   case SIMCALL_MC_RANDOM:
     if (req->issuer->smx_host)
       label =