From 194326c197f1faecc274aa60d3608caacef55bf1 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 18 Mar 2022 21:23:48 +0100 Subject: [PATCH] Specify actor in the MC traces --- src/mc/explo/DFSExplorer.cpp | 6 ++++-- src/mc/transition/TransitionAny.cpp | 8 ++++---- src/mc/transition/TransitionComm.cpp | 8 ++++---- teshsuite/mc/random-bug/random-bug-nocrash.tesh | 4 ++-- teshsuite/mc/random-bug/random-bug.tesh | 12 ++++++------ 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/mc/explo/DFSExplorer.cpp b/src/mc/explo/DFSExplorer.cpp index aede6483ed..99da14492c 100644 --- a/src/mc/explo/DFSExplorer.cpp +++ b/src/mc/explo/DFSExplorer.cpp @@ -68,8 +68,10 @@ RecordTrace DFSExplorer::get_record_trace() // override std::vector DFSExplorer::get_textual_trace() // override { std::vector trace; - for (auto const& state : stack_) - trace.push_back(state->get_transition()->to_string()); + for (auto const& state : stack_) { + auto* t = state->get_transition(); + trace.push_back(xbt::string_printf("%ld: %s", t->aid_, t->to_string().c_str())); + } return trace; } diff --git a/src/mc/transition/TransitionAny.cpp b/src/mc/transition/TransitionAny.cpp index 1335153726..74c84e080d 100644 --- a/src/mc/transition/TransitionAny.cpp +++ b/src/mc/transition/TransitionAny.cpp @@ -32,10 +32,10 @@ TestAnyTransition::TestAnyTransition(aid_t issuer, int times_considered, std::st } std::string TestAnyTransition::to_string(bool verbose) const { - auto res = xbt::string_printf("%ld: TestAny{ ", aid_); + auto res = xbt::string_printf("TestAny{ "); for (auto const* t : transitions_) res += t->to_string(verbose); - res += "}"; + res += " }"; return res; } bool TestAnyTransition::depends(const Transition* other) const @@ -54,10 +54,10 @@ WaitAnyTransition::WaitAnyTransition(aid_t issuer, int times_considered, std::st } std::string WaitAnyTransition::to_string(bool verbose) const { - auto res = xbt::string_printf("%ld: WaitAny{ ", aid_); + auto res = xbt::string_printf("WaitAny{ "); for (auto const* t : transitions_) res += t->to_string(verbose); - res += "}"; + res += " }"; return res; } bool WaitAnyTransition::depends(const Transition* other) const diff --git a/src/mc/transition/TransitionComm.cpp b/src/mc/transition/TransitionComm.cpp index 8aaf8113e9..5907f7f95b 100644 --- a/src/mc/transition/TransitionComm.cpp +++ b/src/mc/transition/TransitionComm.cpp @@ -30,7 +30,7 @@ CommWaitTransition::CommWaitTransition(aid_t issuer, int times_considered, std:: } std::string CommWaitTransition::to_string(bool verbose) const { - auto res = xbt::string_printf("%ld: WaitComm(from %ld to %ld, mbox=%u, %s", aid_, sender_, receiver_, mbox_, + auto res = xbt::string_printf("WaitComm(from %ld to %ld, mbox=%u, %s", sender_, receiver_, mbox_, (timeout_ ? "timeout" : "no timeout")); if (verbose) { res += ", sbuff=" + xbt::string_printf("%" PRIxPTR, sbuff_) + ", size=" + std::to_string(size_); @@ -70,7 +70,7 @@ CommTestTransition::CommTestTransition(aid_t issuer, int times_considered, std:: } std::string CommTestTransition::to_string(bool verbose) const { - auto res = xbt::string_printf("%ld: TestComm(from %ld to %ld, mbox=%u", aid_, sender_, receiver_, mbox_); + auto res = xbt::string_printf("TestComm(from %ld to %ld, mbox=%u", sender_, receiver_, mbox_); if (verbose) { res += ", sbuff=" + xbt::string_printf("%" PRIxPTR, sbuff_) + ", size=" + std::to_string(size_); res += ", rbuff=" + xbt::string_printf("%" PRIxPTR, rbuff_); @@ -107,7 +107,7 @@ CommRecvTransition::CommRecvTransition(aid_t issuer, int times_considered, std:: } std::string CommRecvTransition::to_string(bool verbose) const { - auto res = xbt::string_printf("%ld: iRecv(mbox=%u", aid_, mbox_); + auto res = xbt::string_printf("iRecv(mbox=%u", mbox_); if (verbose) res += ", rbuff=" + xbt::string_printf("%" PRIxPTR, rbuff_); res += ")"; @@ -157,7 +157,7 @@ CommSendTransition::CommSendTransition(aid_t issuer, int times_considered, std:: } std::string CommSendTransition::to_string(bool verbose = false) const { - auto res = xbt::string_printf("%ld: iSend(mbox=%u", aid_, mbox_); + auto res = xbt::string_printf("iSend(mbox=%u", mbox_); if (verbose) res += ", sbuff=" + xbt::string_printf("%" PRIxPTR, sbuff_) + ", size=" + std::to_string(size_); res += ")"; diff --git a/teshsuite/mc/random-bug/random-bug-nocrash.tesh b/teshsuite/mc/random-bug/random-bug-nocrash.tesh index c2a007f354..623f4c54c7 100644 --- a/teshsuite/mc/random-bug/random-bug-nocrash.tesh +++ b/teshsuite/mc/random-bug/random-bug-nocrash.tesh @@ -7,8 +7,8 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir > [ 0.000000] (0:maestro@) *** PROPERTY NOT VALID *** > [ 0.000000] (0:maestro@) ************************** > [ 0.000000] (0:maestro@) Counter-example execution trace: -> [ 0.000000] (0:maestro@) Random([0;5] ~> 3) -> [ 0.000000] (0:maestro@) Random([0;5] ~> 4) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 3) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 4) > [ 0.000000] (0:maestro@) Path = 1/3;1/4 > [ 0.000000] (0:maestro@) DFS exploration ended. 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall) diff --git a/teshsuite/mc/random-bug/random-bug.tesh b/teshsuite/mc/random-bug/random-bug.tesh index 1aeb067468..f73d665d47 100644 --- a/teshsuite/mc/random-bug/random-bug.tesh +++ b/teshsuite/mc/random-bug/random-bug.tesh @@ -7,8 +7,8 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug assert ${platfdir > [ 0.000000] (0:maestro@) *** PROPERTY NOT VALID *** > [ 0.000000] (0:maestro@) ************************** > [ 0.000000] (0:maestro@) Counter-example execution trace: -> [ 0.000000] (0:maestro@) Random([0;5] ~> 3) -> [ 0.000000] (0:maestro@) Random([0;5] ~> 4) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 3) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 4) > [ 0.000000] (0:maestro@) Path = 1/3;1/4 > [ 0.000000] (0:maestro@) DFS exploration ended. 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall) @@ -22,8 +22,8 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug abort ${platfdir} > [ 0.000000] (0:maestro@) ************************** > [ 0.000000] (0:maestro@) From signal: Aborted > [ 0.000000] (0:maestro@) Counter-example execution trace: -> [ 0.000000] (0:maestro@) Random([0;5] ~> 3) -> [ 0.000000] (0:maestro@) Random([0;5] ~> 4) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 3) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 4) > [ 0.000000] (0:maestro@) Path = 1/3;1/4 > [ 0.000000] (0:maestro@) DFS exploration ended. 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall) > [ 0.000000] (0:maestro@) Stack trace not displayed because you passed --log=no_loc @@ -45,8 +45,8 @@ $ ${bindir:=.}/../../../bin/simgrid-mc ${bindir:=.}/random-bug segv ${platfdir}/ > [ 0.000000] (0:maestro@) ************************** > [ 0.000000] (0:maestro@) From signal: Segmentation fault > [ 0.000000] (0:maestro@) Counter-example execution trace: -> [ 0.000000] (0:maestro@) Random([0;5] ~> 3) -> [ 0.000000] (0:maestro@) Random([0;5] ~> 4) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 3) +> [ 0.000000] (0:maestro@) 1: Random([0;5] ~> 4) > [ 0.000000] (0:maestro@) Path = 1/3;1/4 > [ 0.000000] (0:maestro@) DFS exploration ended. 27 unique states visited; 22 backtracks (68 transition replays, 19 states visited overall) > [ 0.000000] (0:maestro@) Stack trace not displayed because you passed --log=no_loc -- 2.20.1