Skip to content

Do not record cpu frame on non perf samples - #1651

Merged
apangin merged 2 commits into
async-profiler:masterfrom
Baraa-Hasheesh:no-wall-cpu
Jan 12, 2026
Merged

apangin merged 2 commits into
async-profiler:masterfrom
Baraa-Hasheesh:no-wall-cpu

Conversation

@Baraa-Hasheesh

Copy link
Copy Markdown
Contributor

Description

While analyzing some async-profiler JFRs on some custom tests, I noticed that it's possible for the profiler to incorrectly record an invalid CPU frame when no such capabilities exist for the sample type

This happens when user runs event=cpu-clock,record-cpu,wall,file=profile.jfr

When a wall sample is collected, the profiler will incorrectly assume it has a valid CPU number but that is wrong, as such a check was added to only add the CPU frame for perf samples

This is relevant for all non perf profiling engines when run in parallel with perf

Related issues

N/A

Motivation and context

Do not record invalid CPU information in the collected stacks of non perf samples

How has this been tested?

A new test was added


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

@apangin

apangin commented Jan 12, 2026

Copy link
Copy Markdown
Member

Makes sense. Thanks!

@apangin
apangin merged commit fc9b5c8 into async-profiler:master Jan 12, 2026
27 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.

2 participants