Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4998 Discussions

All .NET Core code is shown as "[Outside any known module]" when running on Linux

EM1
Beginner
1,841 Views

I'm trying to profile a .NET Core 2.0 application on Linux using VTune as described on https://blogs.msdn.microsoft.com/dotnet/2017/10/23/net-core-performance-profiling-with-intel-vtune-amplifier-2018/ The profiler runs, but when I view the results none of my .NET Core assemblies are shown and instead most of the time is spent in "[Outside any known module]":

When I run the same binaries on Windows I get method names in top-down view:

I'm running VTune Amplifier 2018 Update 3 on Windows 7 x64 and Ubuntu 16.04 x64. The Ubuntu machine is a VM running in Virtual Box.

Windows command line: "C:\Program Files (x86)\IntelSWTools\VTune Amplifier 2018\bin64\amplxe-cl.exe" -collect hotspots -mrte-mode managed -- dotnet My.dll

Linux commands: 

sudo -i
source /opt/intel/vtune_amplifier/amplxe-vars.sh
echo 0 | sudo tee /proc/sys/kernel/watchdog >/dev/null
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope >/dev/null
echo 0 | sudo tee /proc/sys/kernel/kptr_restrict >/dev/null
amplxe-cl -collect hotspots -mrte-mode managed -run-pass-thru=--no-altstack -r ~/vtune/out -- My.dll

The "-run-pass-thru=--no-altstack" is to suppress the following error: "amplxe: Error: Stack size provided to sigaltstack is too small. Please increase the stack size to 64K minimum." I don't know if that's related to the problem or not.
 
How do I get it to show the method names on Linux?

 

0 Kudos
10 Replies
PAVEL_G_Intel
Employee
1,841 Views

Hi,

Did you try to run advanced-hotspots against hotspots?

- Pavel

0 Kudos
EM1
Beginner
1,841 Views

Yes, but that fails on Linux:

amplxe: Error:  Cannot enable event-based sampling collection: Architectural Performance Monitoring version is 0. Make sure the <a web-link="https://software.intel.com/en-us/vtune-amplifier-help-on-virtual-machine">vPMU feature is enabled</a> in your hypervisor.

 

I should have mentioned that the Linux machine is a VM, running in VirtualBox - edited that in now. I'm not sure how to enable the "vPMU feature" and that link doesn't tell me. When I run Advanced Hotspots on Windows (from the GUI) it shows very few of my assembly's methods - the main thread seems to be missing, but some methods that run on background threads are shown.

0 Kudos
PAVEL_G_Intel
Employee
1,841 Views

I also found no information about PMU virtualization enabling on VirtualBox. 

Also in topic about VM profiling there is no VirtualBox mentioned as supported. https://software.intel.com/en-us/vtune-amplifier-help-on-virtual-machine

Are you able to change the VM to VMWare?

- Pavel

0 Kudos
EM1
Beginner
1,841 Views

I tried it on an AWS Linux instances and the result is the same - no .NET assemblies in basic hotspot analysis, "make sure vPMU is enabled" when trying advanced analysis. Even if it did run in VMware that wouldn't help me, because AWS is where I'm actually experiencing the performance problem I need to profile (though the application may eventually be run on a physical server, too).

0 Kudos
PAVEL_G_Intel
Employee
1,841 Views

Unfortunately you are not able to collect .Net stacks on linux with hotspots.
To enable advanced hotspots VTune Amplifier need access to hardware counters. So the solutions for you: run collection in virtual machine with PMU virtualization or on physical machine.

0 Kudos
EM1
Beginner
1,841 Views

That's very disappointing - both the limitation itself and the fact that it's not properly documented. I wasted a lot of time trying to do something that, apparently, never had a chance of working.

Firstly, VTune should have clearly told me: Hey, I see you're running basic hotspot analysis on a .NET Core application on Linux! Guess what? The results are going to be useless! Try advanced instead.

Secondly, the error message about PMU when running advanced analysis, or the linked page, should have clearly said that there is no way to enable PMU on hypervisors other than the supported ones listed there.

0 Kudos
Denis_P_Intel
Employee
1,841 Views

EM, thank you for your feedback. Support of .NET Core apps in VTune is available on Windows and Linux and it's limited by the Launch mode and Advanced Hotspots analysis type (more details). Sorry about wasting of your time. I absolutely agree with your concern: VTune should inform clearly if a certain capabilities are not available for .NET Core. It's a subject for improvement for us. About the error message about PMU, typically it's not a problem to enable event-based sampling on the virtual machine if you virtualize performance counters (more details) but you run app in Amazon cloud and have not control on the hypervisor. Do you have a chance to you use either the Bare metal instances or C5 instances in Amazon cloud? Can you run profiling on your own Windows-based machine? Are interested in Basic Hotspots or other analysis types also?

0 Kudos
EM1
Beginner
1,841 Views

I cannot run the profiling only on Windows, because the problem I'm trying to troubleshoot is that our application performs significantly differently on Windows and Linux. This is why I have 2 AWS instances of the same type, one Windows and one Linux, to hopefully do a fair comparison. I may be able to test it on C5 instances, yes. Is it known to work on those? I'd just like to check that, before I spend the time setting it up.

Additionally, there is the problem that Advanced Analysis does not produce meaningful results even on my physical Windows 7 machine. As I mentioned above, the results contain very few of my methods - the main method and its callees are missing, but some background thread methods are present.

By the way, I see warnings like this on Windows, both for my assemblies and some NuGet packages:

Cannot locate file `...\My.dll'. `...\My.dll' does not have code of the expected architecture. Make sure to specify the correct path to the file in the Binary/Symbol Search list of directories.
Cannot locate file `...\.nuget\packages\newtonsoft.json\10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll'. `...\.nuget\packages\newtonsoft.json\10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll' does not have code of the expected architecture. Make sure to specify the correct path to the file in the Binary/Symbol Search list of directories.
 
They happen for both Basic and Advanced hotspot analysis, and Basic shows method names, so I don't think that's related to the problem above, but mentioning it just in case.
0 Kudos
Denis_P_Intel
Employee
1,841 Views

We tested VTune on a AWS Linux-based C5 instance (it works just fine) and did not test on Windows instance. We may perform testing on AWS Windows-based instance but please expect that it will take some time. Regarding meaningful results on a physical Windows 7 machine, did you run Advanced Analysis in Launch mode but not Attach, right?

0 Kudos
EM1
Beginner
1,841 Views

Yes, that was for Launch mode. When I run Advanced Analysis in Attach mode I don't see any of my methods or modules at all. I've really tried everything I could think of and I can only get some meaningful results when:

* Running on Windows
* As Administrator
* In Launch Mode
* With Basic Hotspot analysis
 

0 Kudos
Reply