Asynkron.Profiler
Trigger On
- the repo wants
Asynkron.Profiler or asynkron-profiler
- the user wants automation-friendly profiling output instead of GUI-only tooling
- profiling needs are CPU, allocation, exception, contention, or heap focused and should land as plain-text summaries in CI, scripts, or agent workflows
- the task needs to render an existing
.nettrace, .speedscope.json, .etlx, or .gcdump file into a readable report
Workflow
- Decide whether the task is a new profile capture or rendering an existing trace artifact.
- Prefer built
Release output over dotnet run so the trace represents the target app rather than restore/build noise.
- Install and verify all three tools before assuming the profiler is usable:
asynkron-profiler
dotnet-trace
dotnet-gcdump
- Choose exactly one primary mode first:
--cpu
--memory
--exception
--contention
--heap
- Use
--input <path> when the trace already exists and the task is about rendering or narrowing the report, not recollecting data.
- Refine the output only after the baseline run:
--root <text> to anchor the call tree
--filter <text> to trim tables
--exception-type <text> for exception-heavy flows
--calltree-depth, --calltree-width, --calltree-self, --calltree-sibling-cutoff
- Treat
profile-output/ as the stable output folder for review artifacts and reruns.
- If the task needs process attach, counters, or raw official diagnostics flows rather than this CLI frontend, hand off to
profiling.
Architecture
flowchart LR
A["Profiling task"] --> B{"New run or existing artifact?"}
B -->|New run| C["Build target in Release"]
C --> D["Run `asynkron-profiler --mode -- <command|csproj|sln>`"]
D --> E["Collect via `dotnet-trace` or `dotnet-gcdump`"]
E --> F["Write reports to `profile-output/`"]
B -->|Existing artifact| G["Run `asynkron-profiler --input <path> [--mode]`"]
G --> F
F --> H["Refine output with `--root`, `--filter`, and call tree flags"]
Install
- Install the profiler tool from upstream:
dotnet tool install -g asynkron-profiler --prerelease
dotnet tool install -g dotnet-trace
dotnet tool install -g dotnet-gcdump
asynkron-profiler --help
dotnet-trace --version
dotnet-gcdump --version
Practical Usage
Capture a new profile
dotnet build -c Release
asynkron-profiler --cpu -- ./bin/Release/<tfm>/MyApp
Framework-dependent apps can run through dotnet:
asynkron-profiler --memory -- dotnet ./bin/Release/<tfm>/MyApp.dll
Project and solution paths are also valid when the tool should build and run for you:
asynkron-profiler --contention -- ./MyApp.csproj
asynkron-profiler --exception -- ./MySolution.sln
Render an existing trace
asynkron-profiler --input ./profile-output/app.nettrace --cpu
asynkron-profiler --input ./profile-output/app.etlx --memory
asynkron-profiler --input ./profile-output/app.gcdump --heap
Manual collection with the official tools still fits when the trace must be captured separately:
dotnet-trace collect --output ./profile-output/app.nettrace -- dotnet run MyProject.sln
asynkron-profiler --input ./profile-output/app.nettrace --cpu
Option Patterns
- mode flags:
--cpu for sampled hotspots
--memory for GC allocation ticks and per-type call trees
--exception for thrown counts and throw-site trees
--contention for wait-time trees
--heap for retained heap shape via dotnet-gcdump
- scope and readability:
--root <text> to focus the tree on a subsystem
--filter <text> to narrow function tables
--exception-type <text> when one exception dominates the signal
- output shaping:
--calltree-depth <n>
--calltree-width <n>
--calltree-self
--calltree-sibling-cutoff <n>
- trace replay and project targeting:
--input <path> for .nettrace, .speedscope.json, .etlx, or .gcdump
--tfm <tfm> when the profiler must resolve a specific target framework from a .csproj or .sln
Constraints
- upstream currently documents
.NET SDK 10.x as the supported toolchain baseline
dotnet run is supported but usually produces noisy traces because it captures host, restore, and build work
- the tool is a frontend over
dotnet-trace and dotnet-gcdump, so missing prerequisites or blocked diagnostics IPC will break runs
--heap captures retained heap shape, not CPU or allocation timelines
- this skill is for launched commands or existing trace files; if the task is process attach, counters, or raw trace authoring, prefer
profiling
Deliver
- a repeatable
asynkron-profiler command path for the profiling mode that matches the problem
- explicit install and prerequisite commands
- a clear baseline command plus any focused
--root, --filter, --exception-type, or call-tree options needed for readable output
- trace replay guidance when the task starts from an existing artifact
Validate
asynkron-profiler --help, dotnet-trace --version, and dotnet-gcdump --version all succeed
- the chosen profiling mode matches the question being investigated
- the command profiles built
Release output unless there is a documented reason to accept dotnet run noise
profile-output/ contains the expected report or artifact after the run
- any replay flow uses an input file type that matches the selected mode
References
- overview.md - tool positioning, install paths, prerequisites, and when to choose it over raw diagnostics CLIs
- commands.md - command patterns for capture, replay, and option tuning
- examples.md - mode-by-mode examples, output expectations, and troubleshooting checks
1---2name: asynkron-profiler3description: Use the open-source free `Asynkron.Profiler` dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts. USE FOR: Asynkron.Profiler setup; automation-friendly profiling output; CPU, allocation, exception, contention, and heap investigation. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.4---56# Asynkron.Profiler78## Trigger On910- the repo wants `Asynkron.Profiler` or `asynkron-profiler`11- the user wants automation-friendly profiling output instead of GUI-only tooling12- profiling needs are CPU, allocation, exception, contention, or heap focused and should land as plain-text summaries in CI, scripts, or agent workflows13- the task needs to render an existing `.nettrace`, `.speedscope.json`, `.etlx`, or `.gcdump` file into a readable report1415## Workflow16171. Decide whether the task is a new profile capture or rendering an existing trace artifact.182. Prefer built `Release` output over `dotnet run` so the trace represents the target app rather than restore/build noise.193. Install and verify all three tools before assuming the profiler is usable:20 - `asynkron-profiler`21 - `dotnet-trace`22 - `dotnet-gcdump`234. Choose exactly one primary mode first:24 - `--cpu`25 - `--memory`26 - `--exception`27 - `--contention`28 - `--heap`295. Use `--input <path>` when the trace already exists and the task is about rendering or narrowing the report, not recollecting data.306. Refine the output only after the baseline run:31 - `--root <text>` to anchor the call tree32 - `--filter <text>` to trim tables33 - `--exception-type <text>` for exception-heavy flows34 - `--calltree-depth`, `--calltree-width`, `--calltree-self`, `--calltree-sibling-cutoff`357. Treat `profile-output/` as the stable output folder for review artifacts and reruns.368. If the task needs process attach, counters, or raw official diagnostics flows rather than this CLI frontend, hand off to `profiling`.3738## Architecture3940```mermaid41flowchart LR42 A["Profiling task"] --> B{"New run or existing artifact?"}43 B -->|New run| C["Build target in Release"]44 C --> D["Run `asynkron-profiler --mode -- <command|csproj|sln>`"]45 D --> E["Collect via `dotnet-trace` or `dotnet-gcdump`"]46 E --> F["Write reports to `profile-output/`"]47 B -->|Existing artifact| G["Run `asynkron-profiler --input <path> [--mode]`"]48 G --> F49 F --> H["Refine output with `--root`, `--filter`, and call tree flags"]50```5152## Install5354- Install the profiler tool from upstream:5556```bash57dotnet tool install -g asynkron-profiler --prerelease58```5960- Install prerequisites:6162```bash63dotnet tool install -g dotnet-trace64dotnet tool install -g dotnet-gcdump65```6667- Verify the toolchain:6869```bash70asynkron-profiler --help71dotnet-trace --version72dotnet-gcdump --version73```7475## Practical Usage7677### Capture a new profile7879```bash80dotnet build -c Release81asynkron-profiler --cpu -- ./bin/Release/<tfm>/MyApp82```8384Framework-dependent apps can run through `dotnet`:8586```bash87asynkron-profiler --memory -- dotnet ./bin/Release/<tfm>/MyApp.dll88```8990Project and solution paths are also valid when the tool should build and run for you:9192```bash93asynkron-profiler --contention -- ./MyApp.csproj94asynkron-profiler --exception -- ./MySolution.sln95```9697### Render an existing trace9899```bash100asynkron-profiler --input ./profile-output/app.nettrace --cpu101asynkron-profiler --input ./profile-output/app.etlx --memory102asynkron-profiler --input ./profile-output/app.gcdump --heap103```104105Manual collection with the official tools still fits when the trace must be captured separately:106107```bash108dotnet-trace collect --output ./profile-output/app.nettrace -- dotnet run MyProject.sln109asynkron-profiler --input ./profile-output/app.nettrace --cpu110```111112## Option Patterns113114- mode flags:115 - `--cpu` for sampled hotspots116 - `--memory` for GC allocation ticks and per-type call trees117 - `--exception` for thrown counts and throw-site trees118 - `--contention` for wait-time trees119 - `--heap` for retained heap shape via `dotnet-gcdump`120- scope and readability:121 - `--root <text>` to focus the tree on a subsystem122 - `--filter <text>` to narrow function tables123 - `--exception-type <text>` when one exception dominates the signal124- output shaping:125 - `--calltree-depth <n>`126 - `--calltree-width <n>`127 - `--calltree-self`128 - `--calltree-sibling-cutoff <n>`129- trace replay and project targeting:130 - `--input <path>` for `.nettrace`, `.speedscope.json`, `.etlx`, or `.gcdump`131 - `--tfm <tfm>` when the profiler must resolve a specific target framework from a `.csproj` or `.sln`132133## Constraints134135- upstream currently documents `.NET SDK 10.x` as the supported toolchain baseline136- `dotnet run` is supported but usually produces noisy traces because it captures host, restore, and build work137- the tool is a frontend over `dotnet-trace` and `dotnet-gcdump`, so missing prerequisites or blocked diagnostics IPC will break runs138- `--heap` captures retained heap shape, not CPU or allocation timelines139- this skill is for launched commands or existing trace files; if the task is process attach, counters, or raw trace authoring, prefer `profiling`140141## Deliver142143- a repeatable `asynkron-profiler` command path for the profiling mode that matches the problem144- explicit install and prerequisite commands145- a clear baseline command plus any focused `--root`, `--filter`, `--exception-type`, or call-tree options needed for readable output146- trace replay guidance when the task starts from an existing artifact147148## Validate149150- `asynkron-profiler --help`, `dotnet-trace --version`, and `dotnet-gcdump --version` all succeed151- the chosen profiling mode matches the question being investigated152- the command profiles built `Release` output unless there is a documented reason to accept `dotnet run` noise153- `profile-output/` contains the expected report or artifact after the run154- any replay flow uses an input file type that matches the selected mode155156## References157158- [overview.md](references/overview.md) - tool positioning, install paths, prerequisites, and when to choose it over raw diagnostics CLIs159- [commands.md](references/commands.md) - command patterns for capture, replay, and option tuning160- [examples.md](references/examples.md) - mode-by-mode examples, output expectations, and troubleshooting checks