32 const std::string SEPARATOR =
"|";
35 void armarx::Profiler::FileLoggingStrategy::logEvent(pid_t processId, uint64_t timestamp,
const std::string& executableName,
const std::string& timestampUnit,
const std::string& eventName,
const std::string& parentName,
const std::string& functionName)
37 std::ostringstream logstring;
38 logstring << processId << SEPARATOR
39 << timestamp << SEPARATOR
40 << timestampUnit << SEPARATOR
41 << eventName << SEPARATOR
42 << parentName << SEPARATOR
43 << functionName << SEPARATOR;
46 eventList.push_back(logstring.str());
51 void armarx::Profiler::FileLoggingStrategy::writeFile()
53 std::ofstream outputFile((
id +
".trace").c_str());
54 writeHeader(outputFile);
56 for (std::string logline : eventList)
58 outputFile << logline << std::endl;
65 void armarx::Profiler::FileLoggingStrategy::writeHeader(std::ostream& outputStream)
68 <<
"ProcessID" << SEPARATOR
69 <<
"Timestamp" << SEPARATOR
70 <<
"TimestampUnit" << SEPARATOR
71 <<
"EventType" << SEPARATOR
72 <<
"Parent" << SEPARATOR
73 <<
"Function" << SEPARATOR << std::endl;