Skip to content

[BOLT] Add itrace aggregation for AUX data #70426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

jonathandavies-arm
Copy link
Contributor

If you have a perf.data with Arm ETM data the only way to use perf2bolt with Branch Aggregation is to first run perf inject --itrace=l64i1us -o perf-brstack.data and then pass the new perf-brstack.data into perf2bolt. perf2bolt then runs perf script -F pid,ip,brstack to produce the brstacks.

This PR adds --itrace arg to perf2bolt to enable Itrace Aggregation. It takes a string which is what is passed to the perf script -F pid,ip,brstack --itrace={0}. This command produces the brstacks without having to run perf inject and creating a new perf.data file.

@jonathandavies-arm
Copy link
Contributor Author

Question for reviewers: Do any Bolt tests run Bolt and pass in a perf.data file and check the .fdata is correct?

@jonathandavies-arm
Copy link
Contributor Author

@maksfb @rafaelauler Please can I have a review.

@yota9 yota9 changed the title {BOLT} Add itrace aggregation for AUX data [BOLT] Add itrace aggregation for AUX data Oct 30, 2023
@yota9 yota9 assigned yota9 and unassigned yota9 Oct 30, 2023
@yota9 yota9 added the BOLT label Oct 30, 2023
@yota9
Copy link
Member

yota9 commented Oct 30, 2023

Please use [BOLT] in commit message

@maksfb
Copy link
Contributor

maksfb commented Nov 5, 2023

Question for reviewers: Do any Bolt tests run Bolt and pass in a perf.data file and check the .fdata is correct?

We have several internal tests for perf2bolt, but nothing in open source. @aaupov, is there a plan to port those?

Copy link
Contributor

@maksfb maksfb left a comment

Choose a reason for hiding this comment

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

Thanks! Overall looks good to me, but please check the question about the scope.

@@ -155,6 +160,8 @@ void DataAggregator::findPerfExecutable() {
}

void DataAggregator::start() {
std::string ItracePerfScriptArgs;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to declare ItracePerfScriptArgs in this scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just saw other std::string being declared at the beginning of functions. I've moved the declaration into the if statement scope.

@kbeyls kbeyls merged commit 22bea0c into llvm:main Nov 6, 2023
@aaupov
Copy link
Contributor

aaupov commented Nov 7, 2023

Question for reviewers: Do any Bolt tests run Bolt and pass in a perf.data file and check the .fdata is correct?

We have several internal tests for perf2bolt, but nothing in open source. @aaupov, is there a plan to port those?

Noted. I didn't port those as we had to sanitize inputs and perf data is tricky since it's opaque and captures a lot of system information by default. We do have some perf2bolt tests in rafaelauler/bolt-tests repo, but not a comprehensive suite.

CC @lanza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants