Skip to content
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

Add support for gathering perf map information in load #34

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

bnjbvr
Copy link
Contributor

@bnjbvr bnjbvr commented Mar 16, 2023

This adds support for reading information of perf mappings that can be generated by runtimes, using a very simple format. It's implemented only for the load command, until a nice design is found for the record step.

Unfortunately, while this correctly loads the symbols from the mapping on my machine, then when the report is displayed in Firefox Profiler's UI, the JIT symbols don't show up. Am I missing something here?

@mstange mstange marked this pull request as ready for review March 20, 2023 21:37
@mstange
Copy link
Owner

mstange commented Mar 20, 2023

I've rebased this against the Jitdump work and added a commit on top which I think should make it work. I haven't tested it yet, though. I'll merge it anyway, and then you can test if it works.

This should give us symbols when perf-<pid>.map files are used.
Copy link
Owner

@mstange mstange left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

Comment on lines +259 to +262
let mut split = line.splitn(3, ' ');
let addr = split.next()?;
let len = split.next()?;
let symbol_name = split.next()?;
Copy link
Owner

Choose a reason for hiding this comment

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

I've changed this to use splitn so that we wouldn't need to glue together the last piece with spaces again. I hope perf.map files always use just a single space as a separator.

Copy link
Owner

Choose a reason for hiding this comment

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

Oh, yeah, the "spec" says:

Each line has the following format, fields separated with spaces:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sweet, TIL splitn.

@mstange mstange merged commit 1e5e835 into mstange:main Mar 20, 2023
@bnjbvr bnjbvr deleted the perf-map branch March 21, 2023 09:16
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.

None yet

2 participants