KEMBAR78
Allow specifying a target for CPU profiling by fandreuz · Pull Request #1180 · async-profiler/async-profiler · GitHub
Skip to content

Conversation

@fandreuz
Copy link
Contributor

Description

Allow users to select a specific CPU via --target-cpu to sample only threads running on that CPU. See #481 for the original issue.

Related issues

#481, #919

Motivation and context

See original issues for use cases.

How has this been tested?

I introduced some tests in test.cpu.CpuTests:

  • perfEventsRightTargetCpu tests the number of events sampled when the right CPU is selected;
  • perfEventsWrongTargetCpu tests the number of events sampled when the wrong CPU is selected;

In order to introduce those tests, I had to add a small extension to the test infrastructure in order to allow pinning the newly started process to a specific CPU via taskset.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@fandreuz fandreuz changed the title Allow specifying a specific target for CPU profiling Allow specifying a target for CPU profiling Mar 14, 2025
@visheshruparelia
Copy link
Contributor

visheshruparelia commented Mar 14, 2025

@fandreuz @apangin looks like CI builds did not run on this PR. Is it because of the pending approvals on the workflow?

@fandreuz
Copy link
Contributor Author

@fandreuz @apangin looks like CI builds did not run on this PR. Is it because of the pending approvals on the workflow?

I joined the async-profiler organization just seconds ago, I'd assume new pushes from me will trigger workflows normally

Francesco Andreuzzi and others added 2 commits March 19, 2025 12:38
@apangin apangin merged commit a78793b into async-profiler:master Mar 19, 2025
10 checks passed
@apangin
Copy link
Member

apangin commented Mar 19, 2025

Merged.
Thank you and kudos for the first contribution to async-profiler!

krk pushed a commit to krk/async-profiler that referenced this pull request Mar 24, 2025
@krk krk mentioned this pull request Mar 24, 2025
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.

4 participants