Skip to content

Commit f3e00b1

Browse files
committed
Revert "Fix calltrace_storage counters accumulating across rotations"
This reverts commit e25f439.
1 parent e25f439 commit f3e00b1

1 file changed

Lines changed: 1 addition & 24 deletions

File tree

ddprof-lib/src/main/cpp/callTraceHashTable.cpp

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -106,29 +106,6 @@ ChunkList CallTraceHashTable::clearTableOnly() {
106106
// Wait for all refcount guards to clear before detaching chunks
107107
RefCountGuard::waitForAllRefCountsToClear();
108108

109-
// Compute and decrement the global counters for everything in this table.
110-
// After waitForAllRefCountsToClear() there are no concurrent writers, so
111-
// plain iteration (same pattern as collect()) is safe.
112-
const size_t header_size = sizeof(CallTrace) - sizeof(ASGCT_CallFrame);
113-
long long freed_bytes = 0;
114-
long long freed_traces = 0;
115-
for (LongHashTable *t = _table; t != nullptr; t = t->prev()) {
116-
u64 *keys = t->keys();
117-
CallTraceSample *values = t->values();
118-
u32 capacity = t->capacity();
119-
for (u32 slot = 0; slot < capacity; slot++) {
120-
if (keys[slot] != 0) {
121-
CallTrace *trace = values[slot].acquireTrace();
122-
if (trace != nullptr && trace != CallTraceSample::PREPARING) {
123-
freed_bytes += header_size + trace->num_frames * sizeof(ASGCT_CallFrame);
124-
freed_traces++;
125-
}
126-
}
127-
}
128-
}
129-
Counters::increment(CALLTRACE_STORAGE_BYTES, -freed_bytes);
130-
Counters::increment(CALLTRACE_STORAGE_TRACES, -freed_traces);
131-
132109
// Clear previous chain pointers to prevent traversal during deallocation
133110
for (LongHashTable *table = _table; table != nullptr; table = table->prev()) {
134111
LongHashTable *prev_table = table->prev();
@@ -447,7 +424,7 @@ void CallTraceHashTable::putWithExistingId(CallTrace* source_trace, u64 weight)
447424
table->values()[slot].setTrace(copied_trace);
448425
Counters::increment(CALLTRACE_STORAGE_BYTES, total_size);
449426
Counters::increment(CALLTRACE_STORAGE_TRACES);
450-
427+
451428
// Increment table size
452429
u32 new_size = table->incSize();
453430
probe.updateCapacity(new_size);

0 commit comments

Comments
 (0)