X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/772f8dd3b48f0c9dff20f67a4c2ea1cbbe673f8d..bff0c1c16b4447b3503aa48d11b15243154ed51a:/src/instr/instr_trace.cpp diff --git a/src/instr/instr_trace.cpp b/src/instr/instr_trace.cpp index 149f9371f9..8f6e251fc7 100644 --- a/src/instr/instr_trace.cpp +++ b/src/instr/instr_trace.cpp @@ -6,11 +6,12 @@ #include "src/instr/instr_private.h" #include "src/instr/instr_smpi.h" +#include "src/smpi/private.hpp" #include "xbt/virtu.h" /* sg_cmdline */ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_trace, instr, "tracing event system"); -FILE *tracing_file = NULL; +FILE *tracing_file = nullptr; void print_NULL(paje_event_t event){} @@ -25,7 +26,7 @@ s_instr_trace_writer_t active_writer = { print_NULL, print_NULL }; -xbt_dynar_t buffer = NULL; +xbt_dynar_t buffer = nullptr; void dump_comment (const char *comment) { @@ -57,7 +58,7 @@ void dump_comment_file (const char *filename) void TRACE_init() { - buffer = xbt_dynar_new(sizeof(paje_event_t), NULL); + buffer = xbt_dynar_new(sizeof(paje_event_t), nullptr); } void TRACE_finalize() @@ -79,7 +80,7 @@ void TRACE_paje_dump_buffer (int force) event->free (event); } xbt_dynar_free (&buffer); - buffer = xbt_dynar_new (sizeof(paje_event_t), NULL); + buffer = xbt_dynar_new (sizeof(paje_event_t), nullptr); }else{ paje_event_t event; unsigned int cursor; @@ -342,10 +343,13 @@ void new_pajeSetState (double timestamp, container_t container, type_t type, val ((setState_t)(event->data))->container = container; ((setState_t)(event->data))->value = value; - smpi_trace_call_location_t* loc = smpi_trace_get_call_location(); - - ((setState_t)(event->data))->filename = loc->filename; - ((setState_t)(event->data))->linenumber = loc->linenumber; +#if HAVE_SMPI + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { + smpi_trace_call_location_t* loc = smpi_trace_get_call_location(); + ((setState_t)(event->data))->filename = loc->filename; + ((setState_t)(event->data))->linenumber = loc->linenumber; + } +#endif XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp); @@ -366,9 +370,13 @@ void new_pajePushStateWithExtra (double timestamp, container_t container, type_t ((pushState_t)(event->data))->value = value; ((pushState_t)(event->data))->extra = extra; - smpi_trace_call_location_t* loc = smpi_trace_get_call_location(); - ((pushState_t)(event->data))->filename = loc->filename; - ((pushState_t)(event->data))->linenumber = loc->linenumber; +#if HAVE_SMPI + if (xbt_cfg_get_boolean("smpi/trace-call-location")) { + smpi_trace_call_location_t* loc = smpi_trace_get_call_location(); + ((pushState_t)(event->data))->filename = loc->filename; + ((pushState_t)(event->data))->linenumber = loc->linenumber; + } +#endif XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event->event_type, event->timestamp);