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

[Linux] Add initial perf jitdump support #13462

Closed
sdmaclea opened this issue Sep 23, 2019 · 7 comments · Fixed by dotnet/coreclr#26897
Closed

[Linux] Add initial perf jitdump support #13462

sdmaclea opened this issue Sep 23, 2019 · 7 comments · Fixed by dotnet/coreclr#26897
Assignees
Labels
area-Diagnostics-coreclr enhancement Product code improvement that does NOT require public API changes/additions os-linux Linux OS (any supported distro)
Milestone

Comments

@sdmaclea
Copy link
Contributor

Linux uses the perf tools to profile application. The linux 4.10 kernel added support for a perf jitdump format.

It has allows better JIT support for perf. Specifically allowing adding:

  • native code so perf can show disassembly of JIT functions.
  • adding debug info to support source line annotation.
  • adding unwind info to better support stack unwind.

I believe this will also allow us to properly support ready to run images.

The app must

  • create the jitdump file. Specification
  • Inform perf inject of its presence by calling mmap with the filename.
  • Add JIT_CODE_LOAD records
  • Optionally add JIT_DEBUG_INFO records
  • Optionally add JIT_CODE_UNWINDING_INFO records

It is used like this

perf record <app>
perf inject --jit
perf report

/cc @dotnet/dotnet-diag

@sdmaclea sdmaclea self-assigned this Sep 23, 2019
@sdmaclea
Copy link
Contributor Author

/cc @janvorli

@adamsitnik
Copy link
Member

Is this going to help with https://github.com/dotnet/coreclr/issues/25965 ?

/cc @damageboy

@damageboy
Copy link
Contributor

@adamsitnik I definitely think so!

@sdmaclea I noticed you self-asssigned this.
Does this mean you will be working on this or is this "up for grabs"?

@sdmaclea
Copy link
Contributor Author

I am debugging a draft patch to implement the JIT_CODE_LOAD records. I plan to create a WIP PR today.

The current patch allows annotating the disassembly of the JITted functions.

I will start looking ar the ReadyToRun functions soon.

I don't plan to add the JIT_DEBUG_INFO or JIT_CODE_UNWINDING_INFO records yet, so that would be "up for grabs".

@damageboy
Copy link
Contributor

@sdmaclea Very cool!

I'd love to test this out if you feel like sharing a branch at some point.

I might also look into the JIT_DEBUG_INFO records, I've peeked around CoreCLR code previously around the internal representation, would be interesting to see if I could pull that off :)

@sdmaclea
Copy link
Contributor Author

@damageboy Thanks for the offer to help. I uploaded dotnet/coreclr#26897, additional debugging would be helpful.

@damageboy
Copy link
Contributor

@sdmaclea
I'm just finishing a family vacation. Will start testing early next week!

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the 5.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Diagnostics-coreclr enhancement Product code improvement that does NOT require public API changes/additions os-linux Linux OS (any supported distro)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants