Dotnet-skills dotnet-asynkron-profiler
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.
install
source · Clone the upstream repo
git clone https://github.com/managedcode/dotnet-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/managedcode/dotnet-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/catalog/Tools/Asynkron-Profiler/skills/dotnet-asynkron-profiler" ~/.claude/skills/managedcode-dotnet-skills-dotnet-asynkron-profiler && rm -rf "$T"
manifest:
catalog/Tools/Asynkron-Profiler/skills/dotnet-asynkron-profiler/SKILL.mdsource content
Asynkron.Profiler
Trigger On
- the repo wants
orAsynkron.Profilerasynkron-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
, or.etlx
file into a readable report.gcdump
Workflow
- Decide whether the task is a new profile capture or rendering an existing trace artifact.
- Prefer built
output overRelease
so the trace represents the target app rather than restore/build noise.dotnet run - Install and verify all three tools before assuming the profiler is usable:
asynkron-profilerdotnet-tracedotnet-gcdump
- Choose exactly one primary mode first:
--cpu--memory--exception--contention--heap
- Use
when the trace already exists and the task is about rendering or narrowing the report, not recollecting data.--input <path> - Refine the output only after the baseline run:
to anchor the call tree--root <text>
to trim tables--filter <text>
for exception-heavy flows--exception-type <text>
,--calltree-depth
,--calltree-width
,--calltree-self--calltree-sibling-cutoff
- Treat
as the stable output folder for review artifacts and reruns.profile-output/ - If the task needs process attach, counters, or raw official diagnostics flows rather than this CLI frontend, hand off to
.dotnet-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
- Install prerequisites:
dotnet tool install -g dotnet-trace dotnet tool install -g dotnet-gcdump
- Verify the toolchain:
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:
for sampled hotspots--cpu
for GC allocation ticks and per-type call trees--memory
for thrown counts and throw-site trees--exception
for wait-time trees--contention
for retained heap shape via--heapdotnet-gcdump
- scope and readability:
to focus the tree on a subsystem--root <text>
to narrow function tables--filter <text>
when one exception dominates the signal--exception-type <text>
- output shaping:
--calltree-depth <n>--calltree-width <n>--calltree-self--calltree-sibling-cutoff <n>
- trace replay and project targeting:
for--input <path>
,.nettrace
,.speedscope.json
, or.etlx.gcdump
when the profiler must resolve a specific target framework from a--tfm <tfm>
or.csproj.sln
Constraints
- upstream currently documents
as the supported toolchain baseline.NET SDK 10.x
is supported but usually produces noisy traces because it captures host, restore, and build workdotnet run- the tool is a frontend over
anddotnet-trace
, so missing prerequisites or blocked diagnostics IPC will break runsdotnet-gcdump
captures retained heap shape, not CPU or allocation timelines--heap- this skill is for launched commands or existing trace files; if the task is process attach, counters, or raw trace authoring, prefer
dotnet-profiling
Deliver
- a repeatable
command path for the profiling mode that matches the problemasynkron-profiler - explicit install and prerequisite commands
- a clear baseline command plus any focused
,--root
,--filter
, or call-tree options needed for readable output--exception-type - trace replay guidance when the task starts from an existing artifact
Validate
,asynkron-profiler --help
, anddotnet-trace --version
all succeeddotnet-gcdump --version- the chosen profiling mode matches the question being investigated
- the command profiles built
output unless there is a documented reason to acceptRelease
noisedotnet run
contains the expected report or artifact after the runprofile-output/- 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