Skip to content

Conversation

arielb1
Copy link
Collaborator

@arielb1 arielb1 commented Aug 3, 2025

ci: use async-profiler from upstream

Add an explicit allocation since the new async-profiler doesn't capture its own allocations.

the original example code didn't call handle.stop, which led to a race between shutdown and async-profiler pushing the new JFR. In upstream async-profiler, the race was often lost. Add that, then change the integration test to ignore overly-short samples to avoid it erroring.

Fixes #84.

📬 Issue #, if available:

✍️ Description of changes:

🔏 By submitting this pull request

  • I confirm that I've made a best effort attempt to update all relevant documentation.
  • I confirm that my contribution is made under the terms of the Apache 2.0 license.

@arielb1 arielb1 force-pushed the upstream-async-profiler branch from f571dfe to ddbc5dc Compare August 4, 2025 12:13
@arielb1 arielb1 requested a review from rcoh August 4, 2025 12:13
Add an explicit allocation since the new async-profiler doesn't capture
its own allocations.

the original example code didn't call `handle.stop`, which led to a race
between shutdown and async-profiler pushing the new JFR. In upstream
async-profiler, the race was often lost. Add that, then change the
integration test to ignore overly-short samples to avoid it erroring.
@arielb1 arielb1 force-pushed the upstream-async-profiler branch from ddbc5dc to f40e3a1 Compare August 4, 2025 12:15
@arielb1 arielb1 changed the title ci: use async-profiler from upstream ci: use async-profiler from upstream, fix CI partial profiles Aug 4, 2025
@arielb1 arielb1 changed the title ci: use async-profiler from upstream, fix CI partial profiles ci: use async-profiler from upstream, fix integration test errors Aug 4, 2025
- name: Download async-profiler
shell: bash
working-directory: tests
run: wget https://github.com/async-profiler/async-profiler/releases/download/v4.1/async-profiler-4.1-linux-x64.tar.gz -O async-profiler.tar.gz && tar xvf async-profiler.tar.gz && mv -vf async-profiler-*/lib/libasyncProfiler.so .
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need some kind of recurring task to keep this up to date? Or is there a way to get the URL for the latest release? Alternatively I guess we could vend this version somehow?

I just want to avoid the case where we're testing on a different version than our customers are using, especially since pollcatch is using those unstable APIs

stack_depth: usize,
},
/// Print the total duration (in seconds) of the JFR recording. Used in the integration tests.
Duration {
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if we made this show (and currently it only prints duration) but it could be a generally useful place to put metadata that people can use?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is intended for use by a very specific shell script

@arielb1 arielb1 merged commit 704a453 into async-profiler:main Aug 4, 2025
14 checks passed
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.

switch to using async-profiler from upstream

2 participants