Skip to content

Add unwinding validation and reporting - #274

Merged
jbachorik merged 10 commits into
mainfrom
jb/unwinding_2
Sep 17, 2025
Merged

Add unwinding validation and reporting#274
jbachorik merged 10 commits into
mainfrom
jb/unwinding_2

Conversation

@jbachorik

@jbachorikjbachorik commented Sep 15, 2025

Copy link
Copy Markdown
Collaborator

What does this PR do?:
This PR adds a bunch of scenarios that are quite challening for the vmstructs unwinder and measures the error rate based on various 'unknown()', 'break_' and 'invalid_' frames.

Motivation:
We want to have a way to see if our changes in the unwinding engine are actually making anything better or not.

Additional Notes:
During my work on this I had to bump the async-profiler base and then reworked the patching to be more 'sane'.

The validation is not blowing up tests (yet) but rather adds the metrics to the CI run report so one can get the glimpse on how each combination of os/arch/java version is doing.
The reports are also stored in the persisted reports so they can be downloaded.

How to test the change?:

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: PROF-12462

Unsure? Have a question? Request a review!

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [aarch64 wall]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modeswallwall
wallonon

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 20 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [aarch64 memleak,alloc]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
alloconon
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakonon
modesmemleak,allocmemleak,alloc
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 20 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [aarch64 alloc]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
alloconon
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modesallocalloc
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 20 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [aarch64 cpu,wall,alloc,memleak]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
alloconon
cpuonon
iterations55
java"11.0.28""11.0.28"
memleakonon
modescpu,wall,alloc,memleakcpu,wall,alloc,memleak
wallonon

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 20 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [aarch64 cpu,wall]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuonon
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modescpu,wallcpu,wall
wallonon

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 17 metrics, 21 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [x86_64 cpu,wall]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuonon
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modescpu,wallcpu,wall
wallonon

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

@pr-commenter

Copy link
Copy Markdown

Benchmarks [x86_64 cpu,wall,alloc,memleak]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
alloconon
cpuonon
iterations55
java"11.0.28""11.0.28"
memleakonon
modescpu,wall,alloc,memleakcpu,wall,alloc,memleak
wallonon

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 15 metrics, 23 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [x86_64 memleak,alloc]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
alloconon
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakonon
modesmemleak,allocmemleak,alloc
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 15, 2025

Copy link
Copy Markdown

Benchmarks [x86_64 memleak]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakonon
modesmemleakmemleak
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

TEXT, JSON, MARKDOWN
}
public enum Scenario {
C2_COMPILATION_TRIGGERS("C2CompilationTriggers"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could any of the scenarios interfere with the behavior of others, i.e. in the case where we run all of them?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should not. They are not run in parallel, and the only ones I would expect to be sensitive would be the JIT related ones. But we are JITing methods specific to that scenario, so we should be +- ok.

Of course, with this being dynamic system, it is always with a grain of salt and at least one hand waving, but so far the results look legit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. This thread can act as a little footnote in case you do see interference-induced failures in the future.

@pr-commenter

pr-commenterBot commented Sep 16, 2025

Copy link
Copy Markdown

Benchmarks [x86_64 cpu]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuonon
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modescpucpu
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 22 unstable metrics.

@pr-commenter

pr-commenterBot commented Sep 16, 2025

Copy link
Copy Markdown

Benchmarks [aarch64 cpu]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuonon
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modescpucpu
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 17 metrics, 21 unstable metrics.

const void *min_address = NO_MIN_ADDRESS,
const void *max_address = NO_MAX_ADDRESS,
const char* image_base = NULL);
const char* image_base = NULL,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use nullptr instead.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's address this in a followup PR.
This one is already pretty big and if I change NULL->nullptr I want to do it consistently and it will cause changes in 47 files 😱
I have the change ready but will post it as a separate PR, together with the update the to tooling such that spotless is enforcing nullptr instead of NULL

@@ -1,180 +0,0 @@
/*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you do git mv instead? so can spot the diffs easily.

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time, perhaps. Unbundling the commits and doing the manual git moves will take quite a lot of time for very little benefit in this case. The dwarf_dd.h is a wrapper around dwarf.h, meaning that I would force git to accept this as a move because the contents are very much not alike.

Comment threadddprof-lib/src/main/cpp/dwarf_dd.h Outdated
};
}

// class DwarfParser {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented out code?

@pr-commenter

Copy link
Copy Markdown

Benchmarks [x86_64 wall]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modeswallwall
wallonon

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

@pr-commenter

Copy link
Copy Markdown

Benchmarks [x86_64 alloc]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
alloconon
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakoffoff
modesallocalloc
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 14 metrics, 24 unstable metrics.

@pr-commenter

Copy link
Copy Markdown

Benchmarks [aarch64 memleak]

Parameters

BaselineCandidate
configbaselinecandidate
ddprof1.31.01.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
BaselineCandidate
allocoffoff
cpuoffoff
iterations55
java"11.0.28""11.0.28"
memleakonon
modesmemleakmemleak
walloffoff

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 20 unstable metrics.

@jbachorik
jbachorik merged commit 21523a3 into mainSep 17, 2025
95 checks passed
@jbachorik
jbachorik deleted the jb/unwinding_2 branch September 17, 2025 13:29
@github-actionsgithub-actionsBot added this to the 1.32.0 milestone Sep 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jbachorik@zhengyu123@MattAlp