X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f0534a5e2af72c36c12d55f7ea323040e6e9bf36..7e625e5e848a284b522d69ec28cb111f1f88515b:/src/mc/explo/Exploration.cpp diff --git a/src/mc/explo/Exploration.cpp b/src/mc/explo/Exploration.cpp index 8bf01108a3..58bc34d610 100644 --- a/src/mc/explo/Exploration.cpp +++ b/src/mc/explo/Exploration.cpp @@ -10,10 +10,6 @@ #include "src/mc/mc_private.hpp" #include "xbt/string.hpp" -#if SIMGRID_HAVE_STATEFUL_MC -#include "src/mc/sosp/RemoteProcessMemory.hpp" -#endif - #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_explo, mc, "Generic exploration algorithm of the model-checker"); @@ -25,8 +21,7 @@ static simgrid::config::Flag cfg_dot_output_file{ Exploration* Exploration::instance_ = nullptr; // singleton instance -Exploration::Exploration(const std::vector& args, bool need_memory_introspection) - : remote_app_(std::make_unique(args, need_memory_introspection)) +Exploration::Exploration(const std::vector& args) : remote_app_(std::make_unique(args)) { xbt_assert(instance_ == nullptr, "Cannot have more than one exploration instance"); instance_ = this; @@ -83,11 +78,20 @@ static const char* signal_name(int status) } } -std::vector Exploration::get_textual_trace() +std::vector Exploration::get_textual_trace(int max_elements) { std::vector trace; - for (auto const& transition : get_record_trace()) - trace.push_back(xbt::string_printf("%ld: %s", transition->aid_, transition->to_string().c_str())); + for (auto const& transition : get_record_trace()) { + auto const& call_location = transition->get_call_location(); + if (not call_location.empty()) + trace.push_back(xbt::string_printf("Actor %ld in %s ==> simcall: %s", transition->aid_, call_location.c_str(), + transition->to_string().c_str())); + else + trace.push_back(xbt::string_printf("Actor %ld in simcall %s", transition->aid_, transition->to_string().c_str())); + max_elements--; + if (max_elements == 0) + break; + } return trace; } @@ -110,18 +114,6 @@ XBT_ATTRIB_NORETURN void Exploration::report_crash(int status) "--cfg=model-check/replay:'%s'", get_record_trace().to_string().c_str()); log_state(); - if (xbt_log_no_loc) { - XBT_INFO("Stack trace not displayed because you passed --log=no_loc"); - } else { -#if SIMGRID_HAVE_STATEFUL_MC - const auto* memory = get_remote_app().get_remote_process_memory(); - if (memory) { - XBT_INFO("Stack trace:"); - memory->dump_stack(); - } else -#endif - XBT_INFO("Stack trace not shown because there is no memory introspection."); - } throw McError(ExitStatus::PROGRAM_CRASH); }