Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Expire JIT/perf-map address caches at each export cycle, so successful address hits cannot keep an old function name indefinitely. Keep symbol-table entries immutable and reuse their indices through the canonical dictionary function handle.
Motivation
Successful lookups bypass source refreshes. If a runtime reuses a code address and samples continue hitting cached ranges, neither a changed perf-map nor a changed jitdump is read again, even across export cycles.
Re-reading the source also previously changed existing symbol-table entries in place. Saved live-allocation stacks referencing those indices could then acquire a different function name.
Additional Notes
This deliberately bounds cache freshness to an export cycle, rather than adding filesystem checks to every successful lookup. Active JIT sources are reloaded lazily on their next use after each cycle. Within a cycle, existing miss/growth-retry behavior remains unchanged, so address reuse is not necessarily noticed immediately.
Trade-offs:
No public ABI change. This PR does not redesign JIT range-overlap handling or add incremental jitdump parsing. Independent of #563, #564 and #565.
How to test the change?
Added four regression tests covering:
Validated on x86_64 Ubuntu 24 / GCC 14:
runtime_symbol_lookup-uttests and theddprofbuild pass with libdatadog v30 and v46.ipc-utand bothsimple_mallocvariants).git diff --checkpass.Alpine and aarch64 have not been run locally.