X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/92197c7e3516470da6ccee2253d0e515a70a70a9..32892d0df7206a7c14ace5a13f985df1e0a9249a:/src/instr/instr_paje_events.cpp diff --git a/src/instr/instr_paje_events.cpp b/src/instr/instr_paje_events.cpp index 258b4e7a54..626fba2ed9 100644 --- a/src/instr/instr_paje_events.cpp +++ b/src/instr/instr_paje_events.cpp @@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_paje_events, instr, "Paje tracing event system (events)"); extern std::ofstream tracing_file; -std::map tracing_files; // TI specific +extern std::map tracing_files; // TI specific namespace simgrid { namespace instr { @@ -23,9 +23,18 @@ PajeEvent::PajeEvent(Container* container, Type* type, double timestamp, e_event stream_ << std::fixed << std::setprecision(TRACE_precision()); stream_ << eventType_ << " " << timestamp_ << " " << type_->get_id() << " " << container_->get_id(); } - insertIntoBuffer(); + insert_into_buffer(); }; +void PajeEvent::print() +{ + if (trace_format != simgrid::instr::TraceFormat::Paje) + return; + + XBT_DEBUG("Dump %s", stream_.str().c_str()); + tracing_file << stream_.str() << std::endl; +} + StateEvent::StateEvent(Container* container, Type* type, e_event_type event_type, EntityValue* value, TIData* extra) : PajeEvent::PajeEvent(container, type, SIMIX_get_clock(), event_type), value(value), extra_(extra) { @@ -43,7 +52,7 @@ void NewEvent::print() if (trace_format != simgrid::instr::TraceFormat::Paje) return; - stream_ << " " << value->getId(); + stream_ << " " << value->get_id(); XBT_DEBUG("Dump %s", stream_.str().c_str()); tracing_file << stream_.str() << std::endl; @@ -68,7 +77,7 @@ void VariableEvent::print() if (trace_format != simgrid::instr::TraceFormat::Paje) return; - stream_ << " " << value; + stream_ << " " << value_; XBT_DEBUG("Dump %s", stream_.str().c_str()); tracing_file << stream_.str() << std::endl; @@ -79,7 +88,7 @@ void StateEvent::print() if (trace_format == simgrid::instr::TraceFormat::Paje) { if (value != nullptr) // PAJE_PopState Event does not need to have a value - stream_ << " " << value->getId(); + stream_ << " " << value->get_id(); if (TRACE_display_sizes()) stream_ << " " << ((extra_ != nullptr) ? extra_->display_size() : 0); @@ -98,13 +107,13 @@ void StateEvent::print() /* Unimplemented calls are: WAITANY, SENDRECV, SCAN, EXSCAN, SSEND, and ISSEND. */ // FIXME: dirty extract "rank-" from the name, as we want the bare process id here - if (getContainer()->get_name().find("rank-") != 0) - stream_ << getContainer()->get_name() << " " << extra_->print(); + if (get_container()->get_name().find("rank-") != 0) + stream_ << get_container()->get_name() << " " << extra_->print(); else /* Subtract -1 because this is the process id and we transform it to the rank id */ - stream_ << stoi(getContainer()->get_name().erase(0, 5)) - 1 << " " << extra_->print(); + stream_ << stoi(get_container()->get_name().erase(0, 5)) - 1 << " " << extra_->print(); - fprintf(tracing_files.at(getContainer()), "%s\n", stream_.str().c_str()); + *tracing_files.at(get_container()) << stream_.str() << std::endl; } else { THROW_IMPOSSIBLE; }