Skip to content

Conversation

@jbachorik
Copy link
Collaborator

@jbachorik jbachorik commented Sep 15, 2025

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
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [aarch64 wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes wall wall
wall on on

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [aarch64 memleak,alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak,alloc memleak,alloc
wall off off

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [aarch64 alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes alloc alloc
wall off off

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [aarch64 cpu,wall,alloc,memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes cpu,wall,alloc,memleak cpu,wall,alloc,memleak
wall on on

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [aarch64 cpu,wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu,wall cpu,wall
wall on on

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [x86_64 cpu,wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu,wall cpu,wall
wall on on

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [x86_64 cpu,wall,alloc,memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes cpu,wall,alloc,memleak cpu,wall,alloc,memleak
wall on on

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [x86_64 memleak,alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak,alloc memleak,alloc
wall off off

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 15, 2025

Benchmarks [x86_64 memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak memleak
wall off off

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
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
Collaborator Author

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
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
Copy link

pr-commenter bot commented Sep 16, 2025

Benchmarks [x86_64 cpu]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu cpu
wall off off

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 16, 2025

Benchmarks [aarch64 cpu]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu on on
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes cpu cpu
wall off off

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
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
Collaborator Author

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
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
Collaborator Author

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.

};
}

// class DwarfParser {
Copy link
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

pr-commenter bot commented Sep 16, 2025

Benchmarks [x86_64 wall]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes wall wall
wall on on

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 16, 2025

Benchmarks [x86_64 alloc]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc on on
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak off off
modes alloc alloc
wall off off

Summary

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

@pr-commenter
Copy link

pr-commenter bot commented Sep 16, 2025

Benchmarks [aarch64 memleak]

Parameters

Baseline Candidate
config baseline candidate
ddprof 1.31.0 1.32.0-jb_unwinding_2-SNAPSHOT
See matching parameters
Baseline Candidate
alloc off off
cpu off off
iterations 5 5
java "11.0.28" "11.0.28"
memleak on on
modes memleak memleak
wall off off

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 main Sep 17, 2025
95 checks passed
@jbachorik jbachorik deleted the jb/unwinding_2 branch September 17, 2025 13:29
@github-actions github-actions bot added this to the 1.32.0 milestone Sep 17, 2025
Sign up for free to 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.

4 participants