MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / getTrace

Method getTrace

runtime/TimeTrace.cc:48–62  ·  view source on GitHub ↗

* Return a string containing all of the trace records from all of the * thread-local buffers. */

Source from the content-addressed store, hash-verified

46 * thread-local buffers.
47 */
48string
49TimeTrace::getTrace()
50{
51 std::vector<TimeTrace::Buffer*> buffers;
52 string s;
53
54 // Make a copy of the list of traces, so we can do the actual tracing
55 // without holding a lock and without fear of the list changing.
56 {
57 std::lock_guard<std::mutex> guard(mutex);
58 buffers = threadBuffers;
59 }
60 TimeTrace::printInternal(&buffers, &s);
61 return s;
62}
63
64/**
65 * Print all existing trace records to either a user-specified file or to

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected