How do you log function call counts in C++ with vsinstr.exe
I'd like to get a call tree with counts for a C++ dll. This says only supported for .NET:
https://learn.microsoft.com/en-us/visualstudio/profiling/cpu-usage?view=vs-2022 but
Starting in Visual Studio 2022 version 17.6, the Instrumentation tool also supports C/C++, but uses static instrumentation (VSInstr):
https://learn.microsoft.com/en-us/visualstudio/profiling/instrumentation-overview?view=vs-2022#static-instrumentation-tool
Anyway,
- Link with /PROFILE
- "vsinstr myCppDll.dll" - the output indicates it completed successfully
- VSDiagnostics.exe start 1 /attach:xxxxx /loadConfig:AgentConfigs\CpuUsageWithCallCounts.json
- (run the scenario)
- VSDignostics.exe stop 1 /output:counts
Opening counts.diagsession chugs for a while then says "failed to analyze data". Doing the same but with "AgentConfigs\CpuUsageHigh.json" works fine. I'm running VS2022 with all current updates. The current version of vsinstr is unable to inject the code for this?