MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / get_stack_backtrace

Function get_stack_backtrace

bdb/temptable.c:90–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88uint32_t gbl_temptable_count;
89
90static char *get_stack_backtrace(void)
91{
92 void *stack[100] = {0};
93 int nFrames = backtrace(stack, sizeof(stack) / sizeof(void*));
94 if (nFrames > 0) {
95 strbuf *pStr = strbuf_new();
96 for (int i = 0; i < nFrames; i++) {
97 if (i > 0) strbuf_append(pStr, " ");
98 strbuf_appendf(pStr, "%p", stack[i]);
99 }
100 char *zBacktrace = strbuf_disown(pStr);
101 strbuf_free(pStr);
102 return zBacktrace;
103 }
104 return NULL;
105}
106
107unsigned int hashfunc(const void *key, int len)
108{

Callers 2

Calls 5

strbuf_newFunction · 0.50
strbuf_appendFunction · 0.50
strbuf_appendfFunction · 0.50
strbuf_disownFunction · 0.50
strbuf_freeFunction · 0.50

Tested by

no test coverage detected