Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update the profiling docs, mention that VTune works great on Linux #1004

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [email protected]:/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)