Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] .NET 8 simplified dotnet-trace instructions #8436

Merged

Commits on Oct 17, 2023

  1. [docs] .NET 8 simplified dotnet-trace instructions

    Context: dotnet/diagnostics#4081
    Context: dotnet/diagnostics#4090
    Context: dotnet/runtime#88634
    Context: dotnet/diagnostics#4337
    
    Using the latest `dotnet-trace` tooling:
    
        > dotnet tool list -g
        Package Id                         Version                       Commands
        --------------------------------------------------------------------------------------
        dotnet-dsrouter                    7.0.447801                    dotnet-dsrouter
        dotnet-gcdump                      7.0.447801                    dotnet-gcdump
        dotnet-trace                       7.0.447801                    dotnet-trace
    
    There is a simplified way to profile Android apps.
    
    For an Android emulator:
    
        > dotnet-dsrouter android-emu
        Start an application on android emulator with one of the following environment variables set:
        DOTNET_DiagnosticPorts=10.0.2.2:9000,nosuspend,connect
        DOTNET_DiagnosticPorts=10.0.2.2:9000,suspend,connect
        > adb shell setprop debug.mono.profile '10.0.2.2:9000,suspend,connect'
        > dotnet-trace ps
        3248  dotnet-dsrouter
        > dotnet-trace collect -p 3248
        ...
        [00:00:00:09]   Recording trace 3.2522   (MB)
        Press <Enter> or <Ctrl+C> to exit...
    
    For an Android device you will eventually be able to do `dotnet-dsrouter
    android`, except we found one issue.
    
    Until dotnet/diagnostics#4337 is resolved, we can instead do:
    
        > adb reverse tcp:9000 tcp:9001
        > dotnet-dsrouter server-server -tcps 127.0.0.1:9001
        > adb shell setprop debug.mono.profile '127.0.0.1:9000,suspend,connect'
        > dotnet-trace ps
        > dotnet-trace collect -p 3248
    
    We can also now use `dotnet-gcdump`! Instead of `dotnet-trace collect
    -p`, you can simply do:
    
        > dotnet-gcdump collect -p 3248
    
    In both cases these tools *know* that the process ID is a
    `dotnet-dsrouter` process and to do the right thing.
    jonathanpeppers committed Oct 17, 2023
    Configuration menu
    Copy the full SHA
    49baa22 View commit details
    Browse the repository at this point in the history