Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics from patch review
[simgrid.git] / src / instr / instr_trace.cpp
index c98e2a9..e5ebbf2 100644 (file)
@@ -5,6 +5,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #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");
@@ -341,6 +343,14 @@ 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);
 
   insert_into_buffer (event);
@@ -360,6 +370,14 @@ 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);
 
   insert_into_buffer (event);