Skip to content

ddprof_julia: relax assertion to JIT-symbol presence - #124

Draft
r1viollet wants to merge 1 commit into
mainfrom
r1viollet/julia-jit-assertion
Draft

ddprof_julia: relax assertion to JIT-symbol presence#124
r1viollet wants to merge 1 commit into
mainfrom
r1viollet/julia-jit-assertion

Conversation

@r1viollet

Copy link
Copy Markdown
Collaborator

Why

The Julia scenario asserts on stacks matching:

.*true_main.*julia_a_.*
.*true_main.*julia_b_.*

In practice the actual captured stacks look like:

julia;[incomplete];[unknown mapping];jl_toplevel_eval_flex;...;julia_a_73

The [incomplete] / [unknown mapping] cluster between the JIT frame and the outer C++ frames comes from Julia's interpreter and dispatch trampolines (anon-exec pages without DWARF unwind info). That is a stack-walking issue, not a symbolization issue. The current regex couples the two, so the test fails for unwinding reasons and masks the actual signal it was meant to check.

Change

Drop the true_main prefix from both regexes. The assertion now fails iff JIT symbols (which require the JITDump file to be picked up) are missing — regardless of stack-walk quality above them.

Effect

Locally (5 runs each, including under sustained CPU load):

ddprof old assertion new assertion
main fail 5/5 pass 20/20
PR #551 fail 5/5 pass 5/5

Measured JIT percentages stay tight to the expected 31% / 63% (julia_a ≈ 32%, julia_b ≈ 62%). The CI flake (~1/10 runs) where JITDump is silently dropped will now show as julia_a/b dropping toward 0% — clearly attributable to symbolization rather than to unrelated unwind gaps.

Related

Companion to DataDog/ddprof#551 (JITDump startup-race fix).

The previous assertion anchored on `true_main → julia_{a,b}_` in the
same stack. In practice the stacks captured for Julia look like:

    julia;[incomplete];[unknown mapping];jl_toplevel_eval_flex;...;julia_a_73

The `[incomplete]` / `[unknown mapping]` cluster comes from Julia's
interpreter and dispatch trampolines (anon-exec pages without DWARF
unwind info), not from JITDump symbolization. The assertion therefore
failed for an unwinding reason, masking the actual signal it was meant
to check: that JIT symbols are resolved via the JITDump file.

Drop the `true_main` prefix so the assertion fails if and only if JIT
symbols are missing, regardless of stack-walk quality above them. This
makes the test a clean regression check for the JITDump startup race
(DataDog/ddprof#551).
@r1viollet

Copy link
Copy Markdown
Collaborator Author

mostly relevant on arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant