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

Method findCallTrace

src/callTraceStorage.cpp:216–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216CallTrace* CallTraceStorage::findCallTrace(LongHashTable* table, u64 hash) {
217 u64* keys = table->keys();
218 u32 capacity = table->capacity();
219 u32 slot = hash & (capacity - 1);
220 u32 step = 0;
221
222 while (keys[slot] != hash) {
223 if (keys[slot] == 0) {
224 return NULL;
225 }
226 if (++step >= capacity) {
227 return NULL;
228 }
229 slot = (slot + step) & (capacity - 1);
230 }
231
232 return table->values()[slot].trace;
233}
234
235u32 CallTraceStorage::put(int num_frames, ASGCT_CallFrame* frames, u64 counter) {
236 u64 hash = calcHash(num_frames, frames);

Callers

nothing calls this directly

Calls 3

valuesMethod · 0.80
keysMethod · 0.45
capacityMethod · 0.45

Tested by

no test coverage detected