-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Description
Related to #41144
With #45142 it is now possible to use this System.Diagnstics.PerformanceCounter on ARM64. It will function correctly for reading non-.NET perfcounters. .NET application provided perfcounters will still not work, but it will not fail: the instances will just not appear due to lack of the perfcounter.dll which exposes them to Windows.
Configuration
- Which version of .NET is the code running on? -- .NET 5.0
- What OS and version, and what distro if applicable? -- Windows 10
- What is the architecture (x64, x86, ARM, ARM64)? -- ARM64
- Do you know whether it is specific to that configuration? -- Yes
Regression?
No
Other information
If we wanted to fix this for System.Diagnstics.PerformanceCounter-provided performance counters we would need to port perfcounter.dll to ARM64 and carry this in the package. When registering a performance counter we would need to write the path to this local copy rather than the .NETFramework copy.
Workaround
Mentioned by @sywhang here: #41144 (comment)
It is recommended folks writing new counters use the EventCounters API instead of the System.Diagnostics.PerformanceCounter because it makes the counters cross-platform by default and makes it easier to integrate with the diagnostics pipeline we built around EventPipe in .NET Core. The runtime and several other parts of the stack (ASP.NET Core, BCL, EFCore, etc.) are already doing this, so it fits into the rest of the ecosystem better as well.