microsoft / microsoft/profile-explorer

Missing work/samples - JITed code does not always show up in Profile Explorer

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug enhancement
Dominant language
C#
Stars
286
Forks
27
Avg merge
3d 1h
Merged PRs (30d)
1

Description

It seems Profile Explorer in some scenarios will be missing a lot of work. I have examples where say 20s of CPU work for a process is missing in Profile Explorer but shows up in WPA. This is a bad analysis experience because it misleads the user / analyst causing them to not see this work.

The issue is that Profile Explorer seems to throw away samples from certain JIT code. It seems .NET CLR JIT is supported, as well as ARM Prism emulation. But other JITs like LUA or Java work would hit this issue.

In my trace taken on ARM64, I see work generated from an x64 JIT binary LUA interpreted Scripting language. Additional links:

This issue could happen with other JITed languages like Java as well.

Repro - Load trace with JITed code from LUA - There will be no indication of any samples. Given these by nature the IP will not resolve back to a known module or function, these will be Unknown. I recommend we mark them with Thread name and start module. Something like "JIT_ThreadName_StartModule" or similar so where the work is originating from is more clear.

2nd issue - Prism Emulation Modules / Functions DO show in the samples. However, I am pretty sure there is work to be done so that the Functions are grouped properly and show in the module list.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by loading a trace with JITed Lua code in Profile Explorer and compare its missing samples with WPA. Trace how unknown JIT samples and Prism emulation functions are represented, then confirm that the samples appear with thread and start-module context and that Prism functions are grouped correctly in the module list.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, lua
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.