Skip to content

Commit

Permalink
update the profiling docs, mention that VTune works great on Linux (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsitnik authored Nov 5, 2019
1 parent 3e85548 commit 54d3c9c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
Binary file added docs/img/vtune_linux_asm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/vtune_linux_cpp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/vtune_linux_modules.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 30 additions & 1 deletion docs/profiling-workflow-corefx.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- [Troubleshooting](#Troubleshooting)
- [Code](#Code)
- [Skids](#Skids)
- [Linux](#Linux)
- [PerfCollect](#PerfCollect)
- [Preparing Your Machine](#Preparing-Your-Machine)
- [Preparing Repro](#Preparing-Repro)
Expand Down Expand Up @@ -422,6 +423,8 @@ Intel VTune is a very powerful profiler that allows for low-level profiling:
* identifies hot spots and bottlenecks
* utilizes MSRs to get additional low-level hardware information

VTune **supports Windows, Linux and macOS!**

## When to use

Let's use PerfView to profile the following app that tries to reproduce [Potential regression: Dictionary of Value Types #25842 ](https://github.com/dotnet/coreclr/issues/25842):
Expand Down Expand Up @@ -481,7 +484,7 @@ When we open the Flame Graph we can see that the Call Stack ends at `FindEntry`

## Identifying Hotspots

Run VTune **as Administrator** and click `New Project`:
Run VTune **as Administrator|sudo** and click `New Project`:

![New Project](img/vtune_new_project.png)

Expand Down Expand Up @@ -567,6 +570,30 @@ The profiler shows that a lot of inclusive CPU time was spent on the `xor` opera

![Skids](img/vtune_skids.png)

## Linux

VTune works great on Linux and as of today it's the only fully featured profiler that works with .NET Core on Linux.

It works best when installed and run as `sudo`:

```cmd
sudo ./install_GUI.sh
cd /opt/intel/vtune_amplifier_2019/bin64
sudo ./amplxe-gui
```

It can show CPU time per C++|C# source code line:

![VTune Linux Cpp](img/vtune_linux_cpp.png)

It's capable of solving both managed and native symbols:

![VTune Linux Modules](img/vtune_linux_modules.png)

It can show the disassembly of profiled methods:

![VTune Linux ASM](img/vtune_linux_asm.png)

# PerfCollect

PerfCollect is a simple, yet very powerful script that allows for profiling .NET Core apps on Linux. It is internally leveraging LTTng and using perf.
Expand Down Expand Up @@ -670,6 +697,8 @@ As mentioned previously, currently only PerfView is capable of opening a `PerfCo
scp -r adsitnik@11.222.33.444:/home/adsitnik/Projects/tracing/slowStartsWith.zip C:\traces\startsWith
```

The alternative is to use [VTune](#VTune) which allows for profiling and analyzing profile information on Linux.

Once you get it there, you need to open it with PerfView and follow the [filtering instructions](#filtering) to filter the trace and [analyze the results](#Analyzing-the-Results).

![Sample PerfCollect trace file opened in PerfView](img/perfcollect_perfview.png)

0 comments on commit 54d3c9c

Please sign in to comment.