Only 3 events must be logged in TI mode, but if we don't disable them,
chunks of Pajé trace ends up in the file supposed to be TI formated.
}
void DefineContainerEvent::print() {
}
void DefineContainerEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- stream << " " << type->id
- << " " << type->father->id
- << " " << type->name;
- print_row();
+ 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)this->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;
+ }
+
}
void DefineVariableTypeEvent::print() {
}
void DefineVariableTypeEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- stream << " " << type->id
- << " " << type->father->id
- << " " << type->name;
- if (type->color)
- stream << " \"" << type->color << "\"";
- print_row();
+ 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)this->event_type;
+ stream << " " << type->id
+ << " " << type->father->id
+ << " " << type->name;
+ if (type->color)
+ stream << " \"" << type->color << "\"";
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
DefineStateTypeEvent::DefineStateTypeEvent(type_t type)
}
DefineStateTypeEvent::DefineStateTypeEvent(type_t type)
void DefineStateTypeEvent::print() {
void DefineStateTypeEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- stream << " " << type->id
- << " " << type->father->id
- << " " << type->name;
- print_row();
+ 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)this->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;
+ }
}
void DefineEventTypeEvent::print() {
}
void DefineEventTypeEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- stream << " " << type->id
- << " " << type->father->id
- << " " << type->name;
- print_row();
+ 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)this->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;
+ }
}
DefineLinkTypeEvent::DefineLinkTypeEvent(type_t type, type_t source, type_t dest)
}
DefineLinkTypeEvent::DefineLinkTypeEvent(type_t type, type_t source, type_t dest)
}
void DefineLinkTypeEvent::print() {
}
void DefineLinkTypeEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- stream << " " << type->id
- << " " << type->father->id
- << " " << source->id
- << " " << dest->id
- << " " << type->name;
- print_row();
+ 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)this->event_type;
+ stream << " " << type->id
+ << " " << type->father->id
+ << " " << source->id
+ << " " << dest->id
+ << " " << type->name;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
DefineEntityValueEvent::DefineEntityValueEvent (val_t value)
}
DefineEntityValueEvent::DefineEntityValueEvent (val_t value)
void DefineEntityValueEvent::print() {
void DefineEntityValueEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- stream << " " << value->id
- << " " << value->father->id
- << " " << value->name;
- if(value->color)
- stream << " \"" << value->color << "\"";
- print_row();
+ 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)this->event_type;
+ stream << " " << value->id
+ << " " << value->father->id
+ << " " << value->name;
+ if(value->color)
+ stream << " \"" << value->color << "\"";
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
CreateContainerEvent::CreateContainerEvent (container_t container)
}
CreateContainerEvent::CreateContainerEvent (container_t container)
print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
//if we are in the mode with only one file
print_row();
} else if (instr_fmt_type == instr_fmt_TI) {
//if we are in the mode with only one file
- static FILE *temp = nullptr;
+ static FILE *ti_unique_file = nullptr;
if (tracing_files == nullptr) {
tracing_files = xbt_dict_new_homogeneous(nullptr);
if (tracing_files == nullptr) {
tracing_files = xbt_dict_new_homogeneous(nullptr);
prefix = xbt_os_time();
}
prefix = xbt_os_time();
}
- if (!xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || temp == nullptr) {
+ if (!xbt_cfg_get_boolean("tracing/smpi/format/ti-one-file") || ti_unique_file == nullptr) {
char *folder_name = bprintf("%s_files", TRACE_get_filename());
char *filename = bprintf("%s/%f_%s.txt", folder_name, prefix, container->name);
#ifdef WIN32
char *folder_name = bprintf("%s_files", TRACE_get_filename());
char *filename = bprintf("%s/%f_%s.txt", folder_name, prefix, container->name);
#ifdef WIN32
#else
mkdir(folder_name, S_IRWXU | S_IRWXG | S_IRWXO);
#endif
#else
mkdir(folder_name, S_IRWXU | S_IRWXG | S_IRWXO);
#endif
- temp = fopen(filename, "w");
- xbt_assert(temp, "Tracefile %s could not be opened for writing: %s", filename, strerror(errno));
+ ti_unique_file = fopen(filename, "w");
+ xbt_assert(ti_unique_file, "Tracefile %s could not be opened for writing: %s", filename, strerror(errno));
fprintf(tracing_file, "%s\n", filename);
xbt_free(folder_name);
xbt_free(filename);
}
fprintf(tracing_file, "%s\n", filename);
xbt_free(folder_name);
xbt_free(filename);
}
- xbt_dict_set(tracing_files, container->name, (void *) temp, nullptr);
+ xbt_dict_set(tracing_files, container->name, (void *) ti_unique_file, nullptr);
} else {
THROW_IMPOSSIBLE;
}
} else {
THROW_IMPOSSIBLE;
}
}
void SetVariableEvent::print() {
}
void SetVariableEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id
- << " " << value;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id
+ << " " << value;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value)
}
AddVariableEvent::AddVariableEvent (double timestamp, container_t container, type_t type, double value)
}
void AddVariableEvent::print() {
}
void AddVariableEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id
- << " " << value;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id
+ << " " << value;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
SubVariableEvent::SubVariableEvent (double timestamp, container_t container, type_t type, double value)
}
SubVariableEvent::SubVariableEvent (double timestamp, container_t container, type_t type, double value)
}
void SubVariableEvent::print() {
}
void SubVariableEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id
- << " " << value;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id
+ << " " << value;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
SetStateEvent::SetStateEvent (double timestamp, container_t container, type_t type, val_t value)
}
SetStateEvent::SetStateEvent (double timestamp, container_t container, type_t type, val_t value)
}
void SetStateEvent::print() {
}
void SetStateEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id;
- stream << " " <<value->id;
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id;
+ stream << " " <<value->id;
- if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
- stream << " \"" << filename
- << "\" " << linenumber;
- }
+ if (xbt_cfg_get_boolean("smpi/trace-call-location")) {
+ stream << " \"" << filename
+ << "\" " << linenumber;
+ }
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value, void* extra)
}
PushStateEvent::PushStateEvent (double timestamp, container_t container, type_t type, val_t value, void* extra)
}
void PopStateEvent::print() {
}
void PopStateEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_t type)
}
ResetStateEvent::ResetStateEvent (double timestamp, container_t container, type_t type)
}
void ResetStateEvent::print() {
}
void ResetStateEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
}
StartLinkEvent::StartLinkEvent (double timestamp, container_t container,
}
void StartLinkEvent::print() {
}
void StartLinkEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " <<type->id
- << " " <<container->id
- << " " <<value;
- stream << " " << sourceContainer->id
- << " " << key;
-
- if (TRACE_display_sizes()) {
- stream << " " << size;
- }
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " <<type->id
+ << " " <<container->id
+ << " " <<value;
+ stream << " " << sourceContainer->id
+ << " " << key;
+
+ if (TRACE_display_sizes()) {
+ stream << " " << size;
+ }
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
EndLinkEvent::EndLinkEvent (double timestamp, container_t container, type_t type, container_t destContainer,
}
EndLinkEvent::EndLinkEvent (double timestamp, container_t container, type_t type, container_t destContainer,
void EndLinkEvent::print() {
void EndLinkEvent::print() {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " <<type->id
- << " " <<container->id
- << " " <<value;
- stream << " " << destContainer->id
- << " " << key;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " <<type->id
+ << " " <<container->id
+ << " " <<value;
+ stream << " " << destContainer->id
+ << " " << key;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }
}
NewEvent::NewEvent (double timestamp, container_t container, type_t type, val_t value)
}
NewEvent::NewEvent (double timestamp, container_t container, type_t type, val_t value)
}
void NewEvent::print () {
}
void NewEvent::print () {
- XBT_DEBUG("%s: event_type=%d, timestamp=%.*f", __FUNCTION__, (int)event_type, TRACE_precision(), timestamp);
- stream << std::fixed << std::setprecision(TRACE_precision());
- stream << (int)this->event_type;
- print_timestamp(this);
- stream << " " << type->id
- << " " << container->id
- << " " << value->id;
- print_row();
+ 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)this->event_type;
+ print_timestamp(this);
+ stream << " " << type->id
+ << " " << container->id
+ << " " << value->id;
+ print_row();
+ } else if (instr_fmt_type == instr_fmt_TI) {
+ /* Nothing to do */
+ } else {
+ THROW_IMPOSSIBLE;
+ }