Skip to content

[Linux] Add initial perf jitdump support #13462

Closed
dotnet/coreclr
#26897

Description

@sdmaclea

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

Activity

  1. self-assigned this
    on Sep 23, 2019
  2. sdmaclea commented on Sep 24, 2019

    @sdmaclea
    ContributorAuthor
  3. damageboy commented on Sep 25, 2019

    @damageboy
    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"?

  4. sdmaclea commented on Sep 25, 2019

    @sdmaclea
    ContributorAuthor

    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".

  5. damageboy commented on Sep 25, 2019

    @damageboy
    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 :)

  6. sdmaclea commented on Sep 25, 2019

    @sdmaclea
    ContributorAuthor

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

  7. damageboy commented on Oct 4, 2019

    @damageboy
    Contributor

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

  8. transferred this issue fromdotnet/coreclron Jan 31, 2020
  9. added this to the 5.0 milestone on Jan 31, 2020
  10. ghost locked as resolved and limited conversation to collaborators on Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Diagnostics-coreclrenhancementos-linux

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions