X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d89d9da3b19df5523db58584607c0c6a2859d7ab..138e6f86566611611b1115c957cae0a1c6a85a4b:/src/instr/instr_trace.cpp diff --git a/src/instr/instr_trace.cpp b/src/instr/instr_trace.cpp index cfa70ee568..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,11 +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; +#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); @@ -367,11 +370,13 @@ void new_pajePushStateWithExtra (double timestamp, container_t container, type_t ((pushState_t)(event->data))->value = value; ((pushState_t)(event->data))->extra = extra; +#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);