X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8976bfbf1b73e13049d914169c672eabf7b63164..ebc355d0c96552d0bc2aa301d90723490337bca3:/src/instr/instr_paje_events.hpp diff --git a/src/instr/instr_paje_events.hpp b/src/instr/instr_paje_events.hpp index ebdad78bf7..71dd4c7514 100644 --- a/src/instr/instr_paje_events.hpp +++ b/src/instr/instr_paje_events.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -7,11 +7,14 @@ #define INSTR_PAJE_EVENTS_HPP #include "src/instr/instr_private.hpp" +#include "src/internal_config.h" +#include #include namespace simgrid { namespace instr { class EntityValue; +class TIData; enum e_event_type : unsigned int { PAJE_DefineContainerType, @@ -35,38 +38,42 @@ enum e_event_type : unsigned int { }; class PajeEvent { + Container* container_; + Type* type_; protected: - Container* container; - Type* type; - + Container* get_container() { return container_; } public: double timestamp_; e_event_type eventType_; - PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType) - : container(container), type(type), timestamp_(timestamp), eventType_(eventType){}; - virtual ~PajeEvent(); - virtual void print() = 0; - void insertIntoBuffer(); + std::stringstream stream_; + + PajeEvent(Container* container, Type* type, double timestamp, e_event_type eventType); + virtual ~PajeEvent() = default; + virtual void print(); + void insert_into_buffer(); }; class VariableEvent : public PajeEvent { - double value; + double value_; public: - VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value); + VariableEvent(double timestamp, Container* container, Type* type, e_event_type event_type, double value) + : PajeEvent::PajeEvent(container, type, timestamp, event_type), value_(value) + { + } void print() override; }; class StateEvent : public PajeEvent { EntityValue* value; - std::string filename; - int linenumber; - void* extra_ = nullptr; +#if HAVE_SMPI + std::string filename = "(null)"; + int linenumber = -1; +#endif + TIData* extra_; 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, TIData* extra); void print() override; }; @@ -77,21 +84,28 @@ 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, + const std::string& value, const std::string& key, int size) + : PajeEvent(container, type, SIMIX_get_clock(), event_type) + , endpoint_(sourceContainer) + , value_(value) + , key_(key) + , size_(size) + { + } void print() override; }; class NewEvent : public PajeEvent { - EntityValue* val; + EntityValue* value; public: - NewEvent(double timestamp, Container* container, Type* type, EntityValue* val); + NewEvent(double timestamp, Container* container, Type* type, EntityValue* value) + : simgrid::instr::PajeEvent::PajeEvent(container, type, timestamp, PAJE_NewEvent), value(value) + { + } void print() override; }; } } - #endif