dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.63k stars 4.56k forks source link

[Runtime] Jump stubs appear as `?!?` in ETL traces #88938

Open TIHan opened 1 year ago

TIHan commented 1 year ago

Since we have been analyzing performance on x64 and arm64, one of things that shows up is ?!? which we believe are the jump stubs. The ?!? appears because there is no associated name/dll with the dynamically generated native code.

However, we could fire an ETW event and have perfview recognize it.

Below is an example of ?!?:

image

cc @davidwrighton

kunalspathak commented 1 year ago

@mangod9 - do you think someone from your team could help?

Cc: @davidwrighton

mangod9 commented 1 year ago

@janvorli as well. Just confirming this is only a diagnostics visualization issue and not a perf issue with jump stubs themselves correct?

TIHan commented 1 year ago

Yes, this is just for diagnostic purposes at the moment.

jkotas commented 1 year ago

shows up is ?!? which we believe are the jump stubs.

The Virtual Stub Dispatch stubs show up as ?!? as well.

janvorli commented 1 year ago

There is a bug in PerfView that causes it to ignore some of the messages for stubs and thunks. I have hit that in the past. I have believed I have created an issue for it, but I cannot find it, so apparently, I haven't. I even have a tentative fix in perfview for the issue. I am not sure if it covers all the cases seen in this issue though.

janvorli commented 1 year ago

I've created a PR in PerfView repo with a fix that should fix that fixed the issues I had. As I've said, it might not fix all of the issues seen here.

kunalspathak commented 1 year ago

I've created a PR in PerfView repo with a fix that should fix that fixed the issues I had. As I've said, it might not fix all of the issues seen here.

Thanks @janvorli . Do you mind sharing the PerfView repo PR?

janvorli commented 1 year ago

@kunalspathak I've found that while the perfview fix fixes problem of some runtime helpers not being reported, in fact only the GC write barrier helpers are currently logged on non-win-x86. We don't try to log anything else. I have thought we were logging more of the stubs / helpers, but we've probably just talked about it in the past. However, with a testing trace from @TIHan, there were no entries even for the write barriers (even when an option to log all events was passed to the perfview, which is strange. I am going to investigate that today.

Anyways, we would need to add logging of the stuff that this issue cares about.

The PR in perfview is here: https://github.com/microsoft/perfview/pull/1883

TIHan commented 1 year ago

Thank you @janvorli for looking into this. I imagine this being a bit tricky.