dotprof 1.0.0-rc.3

This is a prerelease version of dotprof.
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global dotprof --version 1.0.0-rc.3
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local dotprof --version 1.0.0-rc.3
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotprof&version=1.0.0-rc.3&prerelease
                    
nuke :add-package dotprof --version 1.0.0-rc.3
                    

<div align="center">

dotprof

Inject trace logs for AI Coding Agents

NuGet

</div>

dotprof is a tracing and profiling tool optimized for AI coding agents.

There are similar tools such as dotnet-trace[^dnt], dotnet-stack[^dns], strace, dotTrace, dntrace, etc, but the existing tools are too sophisticated in AI era.

dotprof can inject traces to Unity assemblies. See Unity Integration.

[^dnt]: dotnet-trace diagnostic tool - .NET CLI - .NET | Microsoft Learn — https://learn.microsoft.com/dotnet/core/diagnostics/dotnet-trace

[^dns]: dotnet-stack diagnostic tool - .NET CLI - .NET | Microsoft Learn — https://learn.microsoft.com/dotnet/core/diagnostics/dotnet-stack

Sample Output

Without having to read the AI-generated code, you can easily understand the execution flow correctness, bottlenecks, etc.

Then you just paste the output, add your review comments, and say "do it".

├─┬ Sandbox.<Main>
│ │   + System.String[]
│ ├─┬ Sandbox.Main
│ │ │   + System.String[]
│ │ ├─┬ <Main>d__0..ctor
│ │ │ └ <Main>d__0..ctor
│ │ │     0.3804ms, 0.00s total, alloc ~= 0 B
│ │ ├─┬ <Main>d__0.MoveNext
│ │ │ ├─┬ Sandbox.NoArgs
│ │ │ │ └ Sandbox.NoArgs
│ │ │ │     0.0095ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Foo..cctor
│ │ │ │ └ Foo..cctor
│ │ │ │     0.0006ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Foo.Alloc1KiB
│ │ │ │ └ Foo.Alloc1KiB
│ │ │ │     0.0002ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Foo.Alloc1KiB
│ │ │ │ └ Foo.Alloc1KiB
│ │ │ │     0.0001ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Foo.Alloc1KiB
│ │ │ │ └ Foo.Alloc1KiB
│ │ │ │     0.0002ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Foo.Alloc1KiB
│ │ │ │ └ Foo.Alloc1KiB
│ │ │ │     0.0001ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Sandbox.Branch_WithoutReturn
│ │ │ │ │   + True
│ │ │ │ ├─┬ Sandbox.<Branch_WithoutReturn>g__true_branch|6_0
│ │ │ │ │ └ Sandbox.<Branch_WithoutReturn>g__true_branch|6_0
│ │ │ │ │     0.0005ms, 0.01s total, alloc ~= 0 B
│ │ │ │ └ Sandbox.Branch_WithoutReturn
│ │ │ │     0.071ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Sandbox.Branch_WithoutReturn
│ │ │ │ │   + False
│ │ │ │ ├─┬ Sandbox.<Branch_WithoutReturn>g__false_branch|6_1
│ │ │ │ │ └ Sandbox.<Branch_WithoutReturn>g__false_branch|6_1
│ │ │ │ │     0.0004ms, 0.01s total, alloc ~= 0 B
│ │ │ │ └ Sandbox.Branch_WithoutReturn
│ │ │ │     0.0588ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Sandbox.Branch_WithReturn
│ │ │ │ │   + True
│ │ │ │ ├─┬ Sandbox.<Branch_WithReturn>g__true_branch|7_0
│ │ │ │ │ └ Sandbox.<Branch_WithReturn>g__true_branch|7_0
│ │ │ │ │     0.0004ms, 0.01s total, alloc ~= 0 B
│ │ │ │ └ Sandbox.Branch_WithReturn
│ │ │ │     0.0613ms, 0.01s total, alloc ~= 0 B
│ │ │ ├─┬ Sandbox.Branch_WithReturn
│ │ │ │ │   + False
│ │ │ │ ├─┬ Sandbox.<Branch_WithReturn>g__false_branch|7_1
│ │ │ │ │ └ Sandbox.<Branch_WithReturn>g__false_branch|7_1
│ │ │ │ │     0.0004ms, 0.01s total, alloc ~= 0 B
│ │ │ │ └ Sandbox.Branch_WithReturn
│ │ │ │     0.062ms, 0.01s total, alloc ~= 8224 B
│ │ │ ├─┬ Sandbox.CI_fails_if_stdout_doesnt_include_this__2255201d_4e66_4fb0_b0c0_f1ee1c005c61
│ │ │ │ └ Sandbox.CI_fails_if_stdout_doesnt_include_this__2255201d_4e66_4fb0_b0c0_f1ee1c005c61
│ │ │ │     0.0004ms, 0.01s total, alloc ~= 0 B
│ │ │ └ <Main>d__0.MoveNext
│ │ │     0.8416ms, 0.01s total, alloc ~= 16448 B
│ │ └ Sandbox.Main
│ │     3.8051ms, 0.01s total, alloc ~= 16448 B
│ └ Sandbox.<Main>
│     4.095ms, 0.01s total, alloc ~= 24672 B

Arguments and Performance Metrics

  • +: Method arguments. Override ToString to customize string representation.
  • Milliseconds: Method, property or constructor execution duration.
  • Total seconds: Elapsed time from app start (technically, it's from static field initialization).
  • Allocation: Delta value of GC.GetTotalMemory from method start.
    • It's a total, not per-method allocation - new byte[1024] takes 8,224 bytes at once.

Basic Usage

# Install as a global tool
dotnet tool install -g dotprof

# Or, use with dnx
dnx -y dotprof -- [args]

# Inject traces to current repo
dotprof --framework net10.0

# Inject traces to only members whose full name has Foo or Bar
dotprof --targets Foo,Bar

Test Mode

Inject and view traces using dotnet test without complicated setups.

# Usage ('-' is a delimiter)
dotprof test [options] - [args]

# Example
dotprof test -p ./Foo - --filter Name~Foo

    # Automatically run the following commands
    dotprof -p ./Foo
    dotnet test --filter Name~Foo

CLI Mode

Build and inject traces and then run resulting .dll with dotnet <dll> [args].

# Usage: Inject options and CLI arguments are separated by '-'
dotprof [options] - [args]

# Example: Build ./src and run with args 'foo --bar=baz'
dotprof -p ./src - foo --bar=baz

Unity Integration

You can inject traces with custom logger such as UnityEngine.Debug.Log.

dotprof --logger UnityEngine.Debug.Log -p foo.dll

Logger method signature must be void Method(object).

Technical Note

Console.OutputEncoding

Injected traces force set OutputEncoding to Encoding.UTF8.

Troubleshooting

Traces not appear in console

Try run dotprof once again.

First-time execution may not work as expected (help wanted).

Failed to read environment variable [DOTNET_STARTUP_HOOKS], HRESULT: 0x80070002

If this error occurs even if you didn't set, run:

set DOTNET_STARTUP_HOOKS=

NOTE: It is not set in this tool. Not sure why this happens.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.3.0 123 7/10/2026
1.3.0-rc.1 63 7/10/2026
1.2.0 107 7/7/2026
1.2.0-rc.1 62 7/7/2026
1.1.0 102 7/4/2026
1.0.2 104 7/2/2026
1.0.1 96 7/2/2026
1.0.0 105 7/1/2026
1.0.0-rc.4 60 6/30/2026
1.0.0-rc.3 56 6/30/2026
1.0.0-rc.2 58 6/30/2026
1.0.0-rc.1 62 6/28/2026