1 /* Copyright (c) 2012-2017. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "src/instr/instr_private.hpp"
9 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
10 extern FILE* tracing_file;
15 EntityValue::EntityValue(std::string name, std::string color, Type* father)
16 : id_(instr_new_paje_id()), name_(name), color_(color), father_(father){};
18 void EntityValue::print()
20 if (instr_fmt_type != instr_fmt_paje)
22 std::stringstream stream;
23 XBT_DEBUG("%s: event_type=%u", __FUNCTION__, PAJE_DefineEntityValue);
24 stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineEntityValue;
25 stream << " " << id_ << " " << father_->getId() << " " << name_;
26 if (not color_.empty())
27 stream << " \"" << color_ << "\"";
28 XBT_DEBUG("Dump %s", stream.str().c_str());
29 fprintf(tracing_file, "%s\n", stream.str().c_str());