Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

.NET profiling

RusArtamonov edited this page Jan 26, 2018 · 2 revisions

.NET profiling

Mark up API based on .netstandard 2.0 so you can use it on any supported OS

1. Install .NET SDK

Follow this guide to install .NET SDK specific for your OS

2. Build

Run command dotnet build from folder dotnet to build library

3. Use mark up API in your code

var itt = ITT.CreateDomain(string domainName) - create domain using some domain name.

using (itt.GetTask(string name, ulong id = 0, Task parent = null)) - create a task and define it's scope.

itt.SetCounter(string name, double value, ulong timestamp = 0) - allows to draw overtime graphs.

itt.Marker(string name, Scope scope = Scope.Process, ulong timeStamp = 0, ulong id = 0) - an event without duration, usually drawn as vertical line, scopes are: Scope.Global (over whole timeline), Scope.Process (over current process), Scope.Thread (only in current thread lane). Exception is Scope.Task - shown as task on separate lane that lasts until next Scope.Task marker from this thread.

itt.SubmitTask(string name, ulong timeStamp, ulong dur, ulong id = 0, Task parent = null) - allows streaming tasks from external source.

using (itt.GetTrack(string group, string name)) - all events (of current thread) inside this scope are attributed to pseudo process with name 'group' and pseudo thread named 'name'. 'group == null' leaves events attributed to calling process. But 'name' is mandatory.

timestamp allows handling external source of events. When zero, the event takes the time of the call.

4. Run and collect performance data

4.1 Install Python 2

Follow this link

4.2 Run collector

Use this command to profile your application

python <path to sea_runtool.py> <sea_runtool.py args> ! dotnet <path to your dll>

For example:

python ./runtool/sea_runtool.py -o ./dotnet/bin/Test -f gt qt gv dgml --stacks ! dotnet ./dotnet/bin/netcoreapp2.0/SEAPI_Test.dll

4.3 Use supported performance viewer to view collected data

Supported viewers are listed on main page

Special thanks to Ruslan Artamonov for enabling of .NET profiling in Intel® Single Event API!