Skip to content

Add support for gathering perf map information in load - #34

Merged
mstange merged 2 commits into
mstange:mainfrom
bnjbvr:perf-map
Mar 20, 2023
Merged

mstange merged 2 commits into
mstange:mainfrom
bnjbvr:perf-map

Conversation

@bnjbvr

@bnjbvr bnjbvr commented Mar 16, 2023 •

Copy link
Copy Markdown
Contributor

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

mstange commented Mar 20, 2023

Copy link
Copy Markdown
Owner

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.

@mstange mstange left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants