mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-19 09:39:43 +00:00
SymbolStats now has two additional entry stack maps, which record the call stacks below every occurrence of a symbol in a sample, not only when the symbol was at the top of the stack: - wasReached counts each occurrence separately. If a symbol re-enters itself through recursion, every re-entry adds an entry stack, which will itself contain the symbol somewhere below. - wasReachedNonReentrant counts only the outermost occurrence, so each sample contributes exactly once and recursion is ignored. The sum of counts in this map equals the symbol's inclusive sample count. To achieve this, the call stack is walked bottom-up, which makes the first encountered occurrence of a symbol the outermost one. Symbols at inline positions get the remaining inline frames of their frame group as a synthetic frame, mirroring what was already done for the top of the stack. The wasExecuting and wasExecutingBase maps are now filled by the same walk, as its topmost-frame special case. The keys they receive are identical to what the previous code produced. Note that there is no "base" variant of the reached maps. A base symbol is present as the last frame of every frame group that contains its inline functions, so its wasReached map already covers the whole symbol at base granularity. Merging in the inline symbols' maps, as done for wasExecutingBase, would only multi-count the same samples.