From b4e510a6bb7ee6584ee77d47bec2a6e25c02e166 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Fri, 3 Nov 2017 14:57:18 +0100 Subject: [PATCH] create timestamp at lowest level to save parameters --- src/instr/instr_paje_events.cpp | 21 ++++++++++++--------- src/instr/instr_paje_events.hpp | 14 ++++++-------- src/instr/instr_paje_types.cpp | 13 ++++++------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/instr/instr_paje_events.cpp b/src/instr/instr_paje_events.cpp index 067fb8b5d5..d04a1f912b 100644 --- a/src/instr/instr_paje_events.cpp +++ b/src/instr/instr_paje_events.cpp @@ -22,15 +22,19 @@ NewEvent::NewEvent(double timestamp, container_t container, Type* type, EntityVa insertIntoBuffer(); } -LinkEvent::LinkEvent(double timestamp, container_t container, Type* type, e_event_type event_type, container_t endpoint, +LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type, container_t endpoint, std::string value, std::string key) - : LinkEvent(timestamp, container, type, event_type, endpoint, value, key, -1) + : LinkEvent(container, type, event_type, endpoint, value, key, -1) { } -LinkEvent::LinkEvent(double timestamp, container_t container, Type* type, e_event_type event_type, container_t endpoint, +LinkEvent::LinkEvent(container_t container, Type* type, e_event_type event_type, container_t endpoint, std::string value, std::string key, int size) - : PajeEvent(container, type, timestamp, event_type), endpoint_(endpoint), value_(value), key_(key), size_(size) + : PajeEvent(container, type, SIMIX_get_clock(), event_type) + , endpoint_(endpoint) + , value_(value) + , key_(key) + , size_(size) { XBT_DEBUG("%s: event_type=%u, timestamp=%f, value:%s", __FUNCTION__, eventType_, timestamp_, value_.c_str()); insertIntoBuffer(); @@ -43,14 +47,13 @@ VariableEvent::VariableEvent(double timestamp, Container* container, Type* type, insertIntoBuffer(); } -StateEvent::StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value) - : StateEvent(timestamp, container, type, event_type, value, nullptr) +StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value) + : StateEvent(container, type, event_type, value, nullptr) { } -StateEvent::StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value, - void* extra) - : PajeEvent::PajeEvent(container, type, timestamp, event_type), value(value), extra_(extra) +StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, void* extra) + : PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra) { #if HAVE_SMPI if (xbt_cfg_get_boolean("smpi/trace-call-location")) { diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp index 6f0b3bb4e6..3c2fc02d28 100644 --- a/src/instr/instr_paje_events.hpp +++ b/src/instr/instr_paje_events.hpp @@ -66,9 +66,8 @@ class StateEvent : public PajeEvent { void* extra_ = nullptr; public: - StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value); - StateEvent(double timestamp, Container* container, Type* type, e_event_type event_type, EntityValue* value, - void* extra); + StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value); + StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, void* extra); void print() override; }; @@ -79,10 +78,10 @@ class LinkEvent : public PajeEvent { int size_ = -1; public: - LinkEvent(double timestamp, Container* container, Type* type, e_event_type event_type, Container* sourceContainer, - std::string value, std::string key); - LinkEvent(double timestamp, Container* container, Type* type, e_event_type event_type, Container* sourceContainer, - std::string value, std::string key, int size); + LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value, + std::string key); + LinkEvent(Container* container, Type* type, e_event_type event_type, Container* sourceContainer, std::string value, + std::string key, int size); void print() override; }; @@ -95,5 +94,4 @@ public: }; } } - #endif diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 7261a6a59f..314bc862c1 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -62,23 +62,22 @@ StateType::~StateType() void StateType::setEvent(std::string value_name) { - events_.push_back(new StateEvent(SIMIX_get_clock(), issuer_, this, PAJE_SetState, getEntityValue(value_name))); + events_.push_back(new StateEvent(issuer_, this, PAJE_SetState, getEntityValue(value_name))); } void StateType::pushEvent(std::string value_name, void* extra) { - events_.push_back( - new StateEvent(SIMIX_get_clock(), issuer_, this, PAJE_PushState, getEntityValue(value_name), extra)); + events_.push_back(new StateEvent(issuer_, this, PAJE_PushState, getEntityValue(value_name), extra)); } void StateType::pushEvent(std::string value_name) { - events_.push_back(new StateEvent(SIMIX_get_clock(), issuer_, this, PAJE_PushState, getEntityValue(value_name))); + events_.push_back(new StateEvent(issuer_, this, PAJE_PushState, getEntityValue(value_name))); } void StateType::popEvent() { - events_.push_back(new StateEvent(SIMIX_get_clock(), issuer_, this, PAJE_PopState, nullptr)); + events_.push_back(new StateEvent(issuer_, this, PAJE_PopState, nullptr)); } VariableType::VariableType(std::string name, std::string color, Type* father) : Type(name, name, color, father) @@ -117,12 +116,12 @@ void LinkType::startEvent(container_t startContainer, std::string value, std::st void LinkType::startEvent(container_t startContainer, std::string value, std::string key, int size) { - new LinkEvent(SIMIX_get_clock(), issuer_, this, PAJE_StartLink, startContainer, value, key, size); + new LinkEvent(issuer_, this, PAJE_StartLink, startContainer, value, key, size); } void LinkType::endEvent(container_t endContainer, std::string value, std::string key) { - new LinkEvent(SIMIX_get_clock(), issuer_, this, PAJE_EndLink, endContainer, value, key); + new LinkEvent(issuer_, this, PAJE_EndLink, endContainer, value, key); } void Type::logDefinition(e_event_type event_type) -- 2.20.1