MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / add

Method add

src/callTraceStorage.cpp:293–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293void CallTraceStorage::add(u32 call_trace_id, u64 samples, u64 counter) {
294 if (call_trace_id > capacity()) { // this also covers call_trace_id == OVERFLOW_TRACE_ID
295 return;
296 }
297
298 call_trace_id += (INITIAL_CAPACITY - 1);
299 for (LongHashTable* table = _current_table; table != NULL; table = table->prev()) {
300 if (call_trace_id >= table->capacity()) {
301 CallTraceSample& s = table->values()[call_trace_id - table->capacity()];
302 atomicInc(s.samples, samples);
303 atomicInc(s.counter, counter);
304 break;
305 }
306 }
307}
308
309void CallTraceStorage::resetCounters() {
310 for (LongHashTable* table = _current_table; table != NULL; table = table->prev()) {

Callers

nothing calls this directly

Calls 4

atomicIncFunction · 0.85
prevMethod · 0.80
valuesMethod · 0.80
capacityMethod · 0.45

Tested by

no test coverage detected