Tool Diagnostics & Metrics v1.0.0

pvanalyze

Use `pvanalyze` to inspect existing .NET `.nettrace` files from the command line, including GC, JIT, CPU stacks, allocation, DATAS, events, exceptions, timeline, and call-tree analysis with JSON or SpeedScope. USE FOR: the user mentions pvanalyze, PerfView-style CLI trace analysis, or cross-platform .nettrace inspection; the task starts from an existing .nettrace file and needs. 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.

Trigger On

  • the user mentions pvanalyze, PerfView-style CLI trace analysis, or cross-platform .nettrace inspection
  • the task starts from an existing .nettrace file and needs readable terminal or JSON output
  • an agent or CI workflow needs GC, JIT, CPU stack, allocation, event, exception, timeline, or call-tree summaries
  • SpeedScope export is useful but the source artifact is a .nettrace

Use dotnet-trace-collect or profiling first when the task is mostly about collecting the trace. Use pvanalyze once a trace artifact exists or when the user wants the specific command surface.

Workflow

  1. Confirm the trace path and whether it was collected with the events needed for the question.
  2. Run pvanalyze info <trace.nettrace> first to verify the file opens and contains the expected processes.
  3. Pick one focused analysis command:

- gcstats for GC count, heap size, pause, and GC timeline questions - alloc for allocation-by-type questions - datas for Dynamic Adaptation To Application Sizes heap-count tuning - jitstats for JIT compilation cost - cpustacks for top CPU methods, module grouping, namespace grouping, or SpeedScope export - calltree for hot paths and caller/callee exploration - events for provider, event type, payload, PID, or TID filtering - exceptions for thrown exception summaries and details - timeline or snapshot when an agent needs time-bucketed context

  1. Prefer --format json when another tool or agent will consume the output.
  2. Add --from and --to only after the baseline command confirms the interesting time window.
  3. Use pvanalyze clean <trace-or-directory> when generated .pvanalyze.etlx cache files should be removed.

Deliver

  • the exact dotnet-trace collect command used or needed to capture the right events
  • the focused pvanalyze command and output format
  • the relevant process, time window, provider, event type, or method filter
  • any generated files such as .speedscope.json or .pvanalyze.etlx cache paths that matter for follow-up

Validate

  • pvanalyze --help or dotnet run -c Release -- --help succeeds
  • dotnet-trace --version succeeds when collection is part of the workflow
  • pvanalyze info <trace.nettrace> reads the trace before deeper analysis begins
  • JSON output parses when --format json is used
  • pvanalyze clean <trace-or-directory> removes cache files when cache cleanup is required

References

Related skills

Optimizes hot-path scalar loops in .NET 8+ with cross-platform Vector128/Vector256/Vector512 SIMD intrinsics, or replaces manual math loops with single TensorPrimitives API calls.

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.

Asynkron.Profiler