std::ofstream tracing_file;
std::map<const simgrid::instr::Container*, std::ofstream*> tracing_files; // TI specific
-double prefix = 0.0; // TI specific
constexpr char OPT_TRACING_BASIC[] = "tracing/basic";
constexpr char OPT_TRACING_COMMENT_FILE[] = "tracing/comment-file";
SIMIX_get_clock());
// if we are in the mode with only one file
static std::ofstream* ti_unique_file = nullptr;
+ static double prefix = 0.0;
if (tracing_files.empty()) {
// generate unique run id with time
XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_types, instr, "Paje tracing event system (types)");
-// to check if variables were previously set to 0, otherwise paje won't simulate them
-static std::set<std::string, std::less<>> platform_variables;
-
namespace simgrid {
namespace instr {
* non-determined value, hence causing analysis problems.
*/
+ // to check if variables were previously set to 0, otherwise paje won't simulate them
+ static std::set<std::string, std::less<>> platform_variables;
+
// create a key considering the resource and variable
std::string key = std::string(resource) + get_name();
info->full_types_by_name[t.name] = &t;
}
-static int mc_anonymous_variable_index = 0;
-
static std::unique_ptr<simgrid::mc::Variable> MC_die_to_variable(simgrid::mc::ObjectInformation* info, Dwarf_Die* die,
const Dwarf_Die* /*unit*/,
const simgrid::mc::Frame* frame, const char* ns)
// The current code needs a variable name,
// generate a fake one:
+ static int mc_anonymous_variable_index = 0;
if (variable->name.empty()) {
variable->name = "@anonymous#" + std::to_string(mc_anonymous_variable_index);
mc_anonymous_variable_index++;
// ***** Init
-/** Virtual table for our `libunwind` implementation
- *
- * Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
- * and `ucontext_t` (for processor registers).
- *
- * It works with the `simgrid::mc::UnwindContext` context.
- *
- * Use nullptr as access_fpreg and resume, as we don't need them.
- */
-unw_accessors_t UnwindContext::accessors = {&find_proc_info, &put_unwind_info, &get_dyn_info_list_addr,
- &access_mem, &access_reg, nullptr,
- nullptr, &get_proc_name};
-
unw_addr_space_t UnwindContext::createUnwindAddressSpace()
{
- return unw_create_addr_space(&UnwindContext::accessors, BYTE_ORDER);
+ /** Virtual table for our `libunwind` implementation
+ *
+ * Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
+ * and `ucontext_t` (for processor registers).
+ *
+ * It works with the `simgrid::mc::UnwindContext` context.
+ *
+ * Use nullptr as access_fpreg and resume, as we don't need them.
+ */
+ unw_accessors_t accessors = {&find_proc_info, &put_unwind_info, &get_dyn_info_list_addr, &access_mem, &access_reg,
+ nullptr, nullptr, &get_proc_name};
+ return unw_create_addr_space(&accessors, BYTE_ORDER);
}
void UnwindContext::initialize(simgrid::mc::RemoteSimulation* process, unw_context_t* c)
static int access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t* valp, int write, void* arg) noexcept;
static int get_proc_name(unw_addr_space_t as, unw_word_t addr, char* bufp, size_t buf_len, unw_word_t* offp,
void* arg) noexcept;
- static unw_accessors_t accessors;
public:
// Create a libunwind address space:
namespace simgrid {
namespace unw {
-/** Virtual table for our `libunwind-process_vm_readv` implementation.
- *
- * This implementation reuse most the code of `libunwind-ptrace` but
- * does not use ptrace() to read the target process memory by
- * `process_vm_readv()` or `/dev/${pid}/mem` if possible.
- *
- * Does not support any MC-specific behavior (privatization, snapshots)
- * and `ucontext_t`.
- *
- * It works with `void*` contexts allocated with `_UPT_create(pid)`.
- */
-// TODO, we could get rid of this if we properly stop the model-checked
-// process before reading the memory.
-static unw_accessors_t accessors = {&_UPT_find_proc_info, &_UPT_put_unwind_info, &_UPT_get_dyn_info_list_addr,
- &access_mem, &_UPT_access_reg, &_UPT_access_fpreg,
- &_UPT_resume, &_UPT_get_proc_name};
-
unw_addr_space_t create_addr_space()
{
+ /** Virtual table for our `libunwind-process_vm_readv` implementation.
+ *
+ * This implementation reuse most the code of `libunwind-ptrace` but
+ * does not use ptrace() to read the target process memory by
+ * `process_vm_readv()` or `/dev/${pid}/mem` if possible.
+ *
+ * Does not support any MC-specific behavior (privatization, snapshots)
+ * and `ucontext_t`.
+ *
+ * It works with `void*` contexts allocated with `_UPT_create(pid)`.
+ */
+ // TODO, we could get rid of this if we properly stop the model-checked
+ // process before reading the memory.
+ unw_accessors_t accessors = {&_UPT_find_proc_info, &_UPT_put_unwind_info, &_UPT_get_dyn_info_list_addr,
+ &access_mem, &_UPT_access_reg, &_UPT_access_fpreg,
+ &_UPT_resume, &_UPT_get_proc_name};
return unw_create_addr_space(&accessors, BYTE_ORDER);
}
#if HAVE_PAPI
#include "papi.h"
-extern std::string papi_default_config_name;
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_process, smpi, "Logging specific to SMPI (kernel)");
// TODO: Implement host/process/thread based counters. This implementation
// just always takes the values passed via "default", like this:
// "default:COUNTER1:COUNTER2:COUNTER3;".
- auto it = units2papi_setup.find(papi_default_config_name);
+ auto it = units2papi_setup.find("default");
if (it != units2papi_setup.end()) {
papi_event_set_ = it->second.event_set;
papi_counter_data_ = it->second.counter_data;
#endif
#if HAVE_PAPI
-std::string papi_default_config_name = "default";
std::map</* computation unit name */ std::string, papi_process_data, std::less<>> units2papi_setup;
#endif