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

Diagnostic feedback when disassembly fails is needed #2637

Open
kg opened this issue Sep 12, 2024 · 2 comments
Open

Diagnostic feedback when disassembly fails is needed #2637

kg opened this issue Sep 12, 2024 · 2 comments

Comments

@kg
Copy link
Member

kg commented Sep 12, 2024

After a lot of blindly stumbling around in the dark I got DisassemblyDiagnoser to work for a benchmark I'm iterating on, and then a random change to the code being measured made it suddenly stop disassembling all my benchmarks. The only information or diagnostic output I get is:

No benchmarks were disassembled

It would be awesome if there was some way to get diagnostic information here. Like did decoding the pdb fail? Did nothing get jitted during benchmark execution? etc.

@ThatBusFromSpeed
Copy link

I'm suffering from this same issue right now. I want to look at what some F# code I have is generating, but I've been slamming my head against the wall for about two weeks trying to find any clues as to why disassembly is failing.

@adamsitnik
Copy link
Member

Providing such an information would be very tricky, as we (BDN) use a low level debugger API (ClrMd) to obtain the disassembly.

For example over here you can check what it takes to get in on Intel hardware: https://github.com/dotnet/BenchmarkDotNet/blob/master/src/BenchmarkDotNet/Disassemblers/IntelDisassembler.cs

And here is the arch-agnostic part:
https://github.com/dotnet/BenchmarkDotNet/blob/master/src/BenchmarkDotNet/Disassemblers/ClrMdV3Disassembler.cs

The problem is that even if we add an else block everywhere and print some info I am not sure if this would be actionable from the end user perspective. From my experience, when sth does not work it's usually a runtime or debugger bug...

Over here you can find some docs that explain how to debug it in our repo: https://benchmarkdotnet.org/articles/contributing/disassembler.html#how-to-debug-the-disassembler

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

No branches or pull requests

3 participants