MCPcopy Create free account
hub / github.com/beefytech/Beef / TraceStack

Function TraceStack

BeefRT/gperftools/src/debugallocation.cc:948–954  ·  view source on GitHub ↗

Print the hex stack dump on a single line. PCs are separated by tabs.

Source from the content-addressed store, hash-verified

946
947// Print the hex stack dump on a single line. PCs are separated by tabs.
948static void TraceStack(void) {
949 void *pcs[16];
950 int n = GetStackTrace(pcs, sizeof(pcs)/sizeof(pcs[0]), 0);
951 for (int i = 0; i != n; i++) {
952 TracePrintf(TraceFd(), "\t%p", pcs[i]);
953 }
954}
955
956// This protects MALLOC_TRACE, to make sure its info is atomically written.
957static SpinLock malloc_trace_lock(SpinLock::LINKER_INITIALIZED);

Callers

nothing calls this directly

Calls 3

GetStackTraceFunction · 0.70
TracePrintfFunction · 0.70
TraceFdFunction · 0.70

Tested by

no test coverage detected