X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/da6a8948438ab0798f492ed7bf5dad2a515ca04e..f49bed060ade0139f627e0eb52ce08e12635e6f2:/src/instr/instr_paje_trace.cpp?ds=sidebyside diff --git a/src/instr/instr_paje_trace.cpp b/src/instr/instr_paje_trace.cpp index 5cabc10819..5ef6fb4e31 100644 --- a/src/instr/instr_paje_trace.cpp +++ b/src/instr/instr_paje_trace.cpp @@ -120,9 +120,9 @@ static void print_timestamp(PajeEvent* event) { /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */ if (event->timestamp < 1e-12) stream << 0; - else + else stream << event->timestamp; -} +} /* internal do the instrumentation module */ static void insert_into_buffer (PajeEvent* tbi) @@ -214,40 +214,34 @@ void TRACE_paje_end() { void DefineContainerEvent(type_t type) { - e_event_type event_type = PAJE_DefineContainerType; - double timestamp = 0; - XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type); + XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineContainerType); //print it if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); - stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; - stream << " " << type->id - << " " << type->father->id - << " " << type->name; - print_row(); - } else if (instr_fmt_type == instr_fmt_TI) { - /* Nothing to do */ - } else { - THROW_IMPOSSIBLE; - } + XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineContainerType, TRACE_precision(), 0.); + stream << std::fixed << std::setprecision(TRACE_precision()); + stream << PAJE_DefineContainerType; + stream << " " << type->id << " " << type->father->id << " " << type->name; + print_row(); + } else if (instr_fmt_type == instr_fmt_TI) { + /* Nothing to do */ + } else { + THROW_IMPOSSIBLE; + } //-- } -void DefineVariableTypeEvent(type_t type) +void LogVariableTypeDefinition(type_t type) { - e_event_type event_type = PAJE_DefineVariableType; - double timestamp = 0; - XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type); + XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineVariableType); //print it if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); + XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineVariableType, TRACE_precision(), 0.); stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; + stream << PAJE_DefineVariableType; stream << " " << type->id << " " << type->father->id << " " << type->name; if (type->color) stream << " \"" << type->color << "\""; @@ -260,18 +254,13 @@ if (instr_fmt_type == instr_fmt_paje) { } -void DefineStateTypeEvent(type_t type) +void LogStateTypeDefinition(type_t type) { - e_event_type event_type = PAJE_DefineStateType; - double timestamp = 0; - - XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type); - //print it if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); + XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineStateType, TRACE_precision(), 0.); stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; + stream << PAJE_DefineStateType; stream << " " << type->id << " " << type->father->id << " " << type->name; print_row(); } else if (instr_fmt_type == instr_fmt_TI) { @@ -309,18 +298,14 @@ void DefineEventTypeEvent::print() { } } -void DefineLinkTypeEvent(type_t type, type_t source, type_t dest) +void LogLinkTypeDefinition(type_t type, type_t source, type_t dest) { - e_event_type event_type = PAJE_DefineLinkType; - double timestamp = 0; - - XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type); - + XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineLinkType); //print it if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); + XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, PAJE_DefineLinkType, TRACE_precision(), 0.); stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; + stream << PAJE_DefineLinkType; stream << " " << type->id << " " << type->father->id << " " << source->id << " " << dest->id << " " << type->name; print_row(); } else if (instr_fmt_type == instr_fmt_TI) { @@ -330,18 +315,13 @@ if (instr_fmt_type == instr_fmt_paje) { } } -void DefineEntityValueEvent (val_t value) +void LogEntityValue (val_t value) { - e_event_type event_type = PAJE_DefineEntityValue; - double timestamp = 0; - - XBT_DEBUG("%s: event_type=%d", __FUNCTION__, (int)event_type); - + XBT_DEBUG("%s: event_type=%d", __FUNCTION__, PAJE_DefineEntityValue); //print it if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; + stream << PAJE_DefineEntityValue; stream << " " << value->id << " " << value->father->id << " " << value->name; if (value->color) stream << " \"" << value->color << "\""; @@ -354,25 +334,23 @@ if (instr_fmt_type == instr_fmt_paje) { } -void CreateContainerEvent (container_t container) +void LogContainerCreation (container_t container) { - e_event_type event_type = PAJE_CreateContainer; double timestamp = SIMIX_get_clock(); - XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type,timestamp); + XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_CreateContainer,timestamp); if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; + stream << PAJE_CreateContainer; stream << " "; /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */ - if (timestamp < 1e-12) - stream << 0; - else - stream << timestamp; - stream << " " << container->id << " " << container->type->id << " " << container->father->id << " \"" - << container->name << "\""; + if (timestamp < 1e-12) + stream << 0; + else + stream << timestamp; + stream << " " << container->id << " " << container->type->id << " " << container->father->id << " \"" + << container->name << "\""; print_row(); } else if (instr_fmt_type == instr_fmt_TI) { @@ -407,17 +385,15 @@ if (instr_fmt_type == instr_fmt_paje) { } } -void DestroyContainerEvent (container_t container) +void LogContainerDestruction(container_t container) { - e_event_type event_type = PAJE_DestroyContainer; double timestamp = SIMIX_get_clock(); - XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, timestamp); + XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, PAJE_DestroyContainer, timestamp); if (instr_fmt_type == instr_fmt_paje) { - XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp); stream << std::fixed << std::setprecision(TRACE_precision()); - stream << (int)event_type; + stream << PAJE_DestroyContainer; stream << " "; /* prevent 0.0000 in the trace - this was the behavior before the transition to c++ */ if (timestamp < 1e-12) @@ -789,7 +765,7 @@ ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_ XBT_DEBUG("%s: event_type=%d, timestamp=%f", __FUNCTION__, (int)event_type, this->timestamp); insert_into_buffer (this); - delete [] this; + delete[] this; } void ResetStateEvent::print() {