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] update notes about dotnet-trace and dotnet-gcdump #8713

Merged
merged 5 commits into from
Mar 6, 2024

Conversation

jonathanpeppers
Copy link
Member

  • Mention dotnet-dsrouter android

dotnet/diagnostics#4337

Was fixed by .NET 8 GA, so we can remove the section mentioning it.

  • Mention the relationship between the debug.mono.profile Android system property and $DOTNET_DiagnosticPorts.

  • Mention suspend vs nosuspend.

  • Mention libmono-component-diagnostics_tracing.so and the Mono diagnostic component.

These all came up from conversations with customers, so I think it will be useful for anyone.

* Mention `dotnet-dsrouter android`

dotnet/diagnostics#4337

Was fixed by .NET 8 GA, so we can remove the section mentioning it.

* Mention the relationship between the `debug.mono.profile` Android
  system property and `$DOTNET_DiagnosticPorts`.

* Mention `suspend` vs `nosuspend`.

* Mention `libmono-component-diagnostics_tracing.so` and the Mono
  diagnostic component.

These all came up from conversations with customers, so I think it
will be useful for anyone.
@jonpryor
Copy link
Member

This doc needs to be usable/make sense to someone who doesn't know what they're doing.

Fortunately, I don't know what I'm doing either!

Missing context: the filename is tracing.md, but the title is "Using a device connected via USB". This feels like a mismatch and/or poor ordering.

For starters, "Set up reverse port forwarding" is the first section. Why is this first, especially when it isn't needed for emulator use? This section should be move into the "For profiling an Android application running on an Android device:" section.

Missing sections: it will be handy to be able to link to specific sub-sections. There aren't enough sections to make that useful, e.g. there's no way to link to the "on-device hardware" setup instructions vs. the "emulator" instructions, as they're both in the same "Start the tracing router/proxy on host" section.

I think we need a structure similar to:

  • Tracing: what is it, why would you want to do it? (Surely there are dotnet docs for this. Link to them!)
  • Dependencies: what do you need to trace? How do you get them?
    • dotnet-dsrouter
    • dotnet-trace
    • dotnet-gcdump
  • Configuration/Setup: What do you need to before you begin tracing?
    • Emulator configuration
    • Hardware configuration: presumably here is where you'd mention adb reverse
    • Run dotnet-dsrouter (is here the right spot?)
  • Execution: how do you begin tracing? Presumably "Compile and run the application" would go here. What output is produced? Where is it?
  • Analysis: how do you read the output produced by Execution
    • GC Dumps
    • .nettrace and speedscope files
  • Examples

@AlexeiNaabal
Copy link

AlexeiNaabal commented Feb 19, 2024

  • Mention dotnet-dsrouter android

dotnet/diagnostics#4337

Was fixed by .NET 8 GA, so we can remove the section mentioning it.

  • Mention the relationship between the debug.mono.profile Android system property and $DOTNET_DiagnosticPorts.
  • Mention suspend vs nosuspend.
  • Mention libmono-component-diagnostics_tracing.so and the Mono diagnostic component.

These all came up from conversations with customers, so I think it will be useful for anyone.

@jonathanpeppers Thanks for mentioning these.
I would also like to point out that, if the 9000 port (by default) is occupied by other process, we have to use the server-server config instead, to manually set a different tcps address. In such scenario, one should NOT set the ipcs with option -ipcs, just leave it as the default "", when start the dotnet-dsrouter, otherwise the dotnet-gcdump will not be able to connect the mono application running on the device. I think the ipcs should be able to config in such scenario, making the dsrouter startup config consistent with other tool's (like dotnet-trace) workflow?

@jonathanpeppers
Copy link
Member Author

@AlexeiNaabal if you think something is missing/incorrect can you file an issue here? (just be sure to mention Android)

https://github.com/dotnet/diagnostics/issues

@AlexeiNaabal
Copy link

AlexeiNaabal commented Feb 23, 2024 via email

@roubachof
Copy link

I just followed this improved doc and easily created a speedscope file on a real device.

@AlexeiNaabal
Copy link

I just followed this improved doc and easily created a speedscope file on a real device.

would you like checkout port 9000 is free? If it is free, a simple way to occupy it will be like start the mono debugger connection with port 9000, let the debugger module will occupy the port 9000.

@jonpryor jonpryor merged commit 136dc83 into dotnet:main Mar 6, 2024
44 of 47 checks passed
@jonathanpeppers jonathanpeppers deleted the update-tracing.md branch March 6, 2024 16:59
grendello added a commit that referenced this pull request Mar 7, 2024
* main:
  Bump to xamarin/Java.Interop/main@a7e09b7 (#8793)
  [build] Include MIT license in most NuGet packages (#8787)
  Bump to dotnet/installer@893b762b6e 9.0.100-preview.3.24153.2 (#8782)
  [docs] update notes about `dotnet-trace` and `dotnet-gcdump` (#8713)
grendello added a commit that referenced this pull request Mar 8, 2024
* main:
  [templates] Remove redundant "template" from display name. (#8773)
  Bump to xamarin/Java.Interop/main@a7e09b7 (#8793)
  [build] Include MIT license in most NuGet packages (#8787)
  Bump to dotnet/installer@893b762b6e 9.0.100-preview.3.24153.2 (#8782)
  [docs] update notes about `dotnet-trace` and `dotnet-gcdump` (#8713)
grendello added a commit to grendello/xamarin-android that referenced this pull request Mar 8, 2024
* main: (306 commits)
  [templates] Remove redundant "template" from display name. (dotnet#8773)
  Bump to xamarin/Java.Interop/main@a7e09b7 (dotnet#8793)
  [build] Include MIT license in most NuGet packages (dotnet#8787)
  Bump to dotnet/installer@893b762b6e 9.0.100-preview.3.24153.2 (dotnet#8782)
  [docs] update notes about `dotnet-trace` and `dotnet-gcdump` (dotnet#8713)
  [Mono.Android] Fix race condition in AndroidMessageHandler (dotnet#8753)
  [ci] Fix SDL Sources Analysis for PRs from forks (dotnet#8785)
  [ci] Add 1ESPT override to MSBuild test stages (dotnet#8784)
  [ci] Do not use @self annotation for templates (dotnet#8783)
  [ci] Migrate to the 1ES template (dotnet#8747)
  [Mono.Android] fix trimming warnings, part 2 (dotnet#8758)
  [Xamarin.Android.Build.Tasks] set `%(DefineConstantsOnly)` for older API levels (dotnet#8777)
  [tests] fix duplicate sources in `NuGet.config` (dotnet#8772)
  Bump to xamarin/monodroid@e13723e701 (dotnet#8771)
  Bump to xamarin/xamarin-android-tools/main@37d79c9 (dotnet#8752)
  Bump to dotnet/installer@d070660282 9.0.100-preview.3.24126.2 (dotnet#8763)
  Bump to xamarin/java.interop/main@14a9470 (dotnet#8766)
  $(AndroidPackVersionSuffix)=preview.3; net9 is 34.99.0.preview.3 (dotnet#8765)
  [Mono.Android] Do not dispose request content stream in AndroidMessageHandler (dotnet#8764)
  Bump com.android.tools:r8 from 8.2.42 to 8.2.47 (dotnet#8761)
  ...
grendello added a commit that referenced this pull request Mar 11, 2024
* main:
  [templates] Remove redundant "template" from display name. (#8773)
  Bump to xamarin/Java.Interop/main@a7e09b7 (#8793)
  [build] Include MIT license in most NuGet packages (#8787)
  Bump to dotnet/installer@893b762b6e 9.0.100-preview.3.24153.2 (#8782)
  [docs] update notes about `dotnet-trace` and `dotnet-gcdump` (#8713)
  [Mono.Android] Fix race condition in AndroidMessageHandler (#8753)
  [ci] Fix SDL Sources Analysis for PRs from forks (#8785)
  [ci] Add 1ESPT override to MSBuild test stages (#8784)
  [ci] Do not use @self annotation for templates (#8783)
  [ci] Migrate to the 1ES template (#8747)
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants