Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / instr / instr_paje_values.cpp
1 /* Copyright (c) 2012-2020. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include "src/instr/instr_private.hpp"
8
9 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje_values, instr, "Paje tracing event system (values)");
10 extern std::ofstream tracing_file;
11
12 namespace simgrid {
13 namespace instr {
14
15 EntityValue::EntityValue(const std::string& name, const std::string& color, Type* father)
16     : id_(instr_new_paje_id()), name_(name), color_(color), father_(father){}
17
18 void EntityValue::print()
19 {
20   if (trace_format != simgrid::instr::TraceFormat::Paje)
21     return;
22   std::stringstream stream;
23   XBT_DEBUG("%s: event_type=%u", __func__, PAJE_DefineEntityValue);
24   stream << std::fixed << std::setprecision(TRACE_precision()) << PAJE_DefineEntityValue;
25   stream << " " << id_ << " " << father_->get_id() << " " << name_;
26   if (not color_.empty())
27     stream << " \"" << color_ << "\"";
28   XBT_DEBUG("Dump %s", stream.str().c_str());
29   tracing_file << stream.str() << std::endl;
30 }
31
32 }
33 }