Skip to content

Tags: DataDog/ddprof

Tags

latest-rc

Toggle latest-rc's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(jit): retry jitdump read when file grows (#553)

fix(jit): retry jitdump read when file grows

RuntimeSymbolLookup::get_or_insert_jitdump freezes a (pid, path) pair
for the rest of the export cycle as soon as one sampled PC misses the
symbol map after a successful jitdump read. The intent was to avoid
reparsing the file for every subsequent miss in the same cycle.

The side effect is that a single unlucky first sample -- fired while
the runtime is still flushing jit-<pid>.dump (Julia, .NET) -- produces
zero symbolised JIT frames for the entire run when the scenario only
exports once. This matches the flaky failure seen on the
prof-correctness Julia scenario.

Add a soft-miss retry path: every 64 soft misses on a frozen jitdump,
stat the file via the existing get_file_inode helper. If size or inode
changed since the last read, unfreeze and reparse; otherwise keep the
freeze. Hard read errors keep the existing behaviour (no churn on
unreachable files such as //anon).

The new logic lives in two small helpers (check_jitdump_changed,
read_jitdump) so get_or_insert_jitdump remains a short orchestrator.

Cost: at 99 Hz CPU sampling on up to ~20 cores the worst case is
~30 stat() calls per second profiler-wide, and reparses only happen
when the file actually grew.

Adds three unit tests covering: no growth -> no reread, growth ->
reread + resolve, unreachable path -> no churn.

Co-authored-by: erwan.viollet <erwan.viollet@datadoghq.com>

Verified

This tag was signed with the committer’s verified signature.

Verified

This tag was signed with the committer’s verified signature.
nsavoire Nicolas Savoire

Verified

This tag was signed with the committer’s verified signature.

Verified

This tag was signed with the committer’s verified signature.

Verified

This tag was signed with the committer’s verified signature.

Verified

This tag was signed with the committer’s verified signature.
nsavoire Nicolas Savoire

Verified

This tag was signed with the committer’s verified signature.

Verified

This tag was signed with the committer’s verified signature.

Verified

This tag was signed with the committer’s verified signature.