A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
model-checker : include MUTEX_LOCK and UNLOCK in dot output
[simgrid.git]
/
src
/
mc
/
mc_request.c
diff --git
a/src/mc/mc_request.c
b/src/mc/mc_request.c
index
af7f1ef
..
5b309a3
100644
(file)
--- a/
src/mc/mc_request.c
+++ b/
src/mc/mc_request.c
@@
-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,18
@@
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_MUTEX_UNLOCK:
+ type = xbt_strdup("Mutex UNLOCK");
+ mutex = simcall_mutex_unlock__get__mutex(req);
+ args = bprintf("locked = %d, owner = %lu, sleeping = %d", mutex->locked, mutex->owner->pid, xbt_swag_size(mutex->sleeping));
+ break;
+
case SIMCALL_MC_SNAPSHOT:
type = xbt_strdup("MC_SNAPSHOT");
args = NULL;
@@
-420,7
+433,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
+530,14
@@
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_MUTEX_UNLOCK:
+ label = bprintf("[(%lu)] Mutex UNLOCK", req->issuer->pid);
+ break;
+
case SIMCALL_MC_RANDOM:
if (req->issuer->smx_host)
label =