Skip to content

Document more remarks about the diagnostics CLI tools #22278

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

Merged
merged 3 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/core/diagnostics/dotnet-counters.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ There are two ways to download and install `dotnet-counters`:
| macOS | [x64](https://aka.ms/dotnet-counters/osx-x64) |
| Linux | [x64](https://aka.ms/dotnet-counters/linux-x64) \| [arm](https://aka.ms/dotnet-counters/linux-arm) \| [arm64](https://aka.ms/dotnet-counters/linux-arm64) \| [musl-x64](https://aka.ms/dotnet-counters/linux-musl-x64) \| [musl-arm64](https://aka.ms/dotnet-counters/linux-musl-arm64) |

> [!NOTE]
> To use `dotnet-counters` on an x86 app, you need a corresponding x86 version of the tool.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear how to do this. It might be nice to have more detailed instructions somewhere. Having two versions of the tool on Windows is a bit difficult. I was using the same tool but executing it with the x86 runtime by pointing dotnet at dotnet-dump.dll. It is a bit awkward experience.

This also affects arm32 when analyzing cross dumps on Windows. So you currently need a 32bit dotnet tool process to debug a 32 bit target process or 32 bit dump.

So I guess you would see a similar problem on a arm64 host running a arm32 process. Although I can't say I have seen that problem. So it might not exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback Steve.

AFAIK the easiest/pain-free way for the customers to do this would be to just use the single-file versions of these apps which is why I added the remark here (the most natural thing to do after reading this comment would be to just click the x86 link above).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its OK to leave as is, I didn't really get my bearings. You could consider something like this ...

Suggested change
> To use `dotnet-counters` on an x86 app, you need a corresponding x86 version of the tool.
> To use `dotnet-counters` on an win-x86 app, you need a corresponding [win-x86](https://aka.ms/dotnet-counters/win-x86) direct download version of the tool.


## Synopsis

```console
Expand Down Expand Up @@ -108,6 +111,12 @@ dotnet-counters collect [-h|--help] [-p|--process-id] [-n|--name] [--diagnostic-
> [!NOTE]
> Launching a .NET executable via dotnet-counters will make its input/output to be redirected and you won't be able to interact with its stdin/stdout. Exiting the tool via CTRL+C or SIGTERM will safely end both the tool and the child process. If the child process exits before the tool, the tool will exit as well and the trace should be safely viewable. If you need to use stdin/stdout, you can use the `--diagnostic-port` option. See [Using diagnostic port](#using-diagnostic-port) for more information.

> [!NOTE]
> On Linux and macOS, this command expects the target application and `dotnet-counters` to share the same `TMPDIR` environment variable. Otherwise, the command will time out.

> [!NOTE]
> To collect metrics using `dotnet-counters`, it needs to be run as the same user as the user running target process or as root. Otherwise, the tool will fail to establish a connection with the target process.

### Examples

- Collect all counters at a refresh interval of 3 seconds and generate a csv as output:
Expand Down Expand Up @@ -216,6 +225,12 @@ dotnet-counters monitor [-h|--help] [-p|--process-id] [-n|--name] [--diagnostic-
> [!NOTE]
> Launching a .NET executable via dotnet-counters will make its input/output to be redirected and you won't be able to interact with its stdin/stdout. Exiting the tool via CTRL+C or SIGTERM will safely end both the tool and the child process. If the child process exits before the tool, the tool will exit as well and the trace should be safely viewable. If you need to use stdin/stdout, you can use the `--diagnostic-port` option. See [Using diagnostic port](#using-diagnostic-port) for more information.

> [!NOTE]
> On Linux and macOS, this command expects the target application and `dotnet-counters` to share the same `TMPDIR` environment variable.

> [!NOTE]
> To monitor metrics using `dotnet-counters`, it needs to be run as the same user as the user running target process or as root.

### Examples

- Monitor all counters from `System.Runtime` at a refresh interval of 3 seconds:
Expand Down
9 changes: 9 additions & 0 deletions docs/core/diagnostics/dotnet-dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ There are two ways to download and install `dotnet-dump`:
| macOS | [x64](https://aka.ms/dotnet-dump/osx-x64) |
| Linux | [x64](https://aka.ms/dotnet-dump/linux-x64) \| [arm](https://aka.ms/dotnet-dump/linux-arm) \| [arm64](https://aka.ms/dotnet-dump/linux-arm64) \| [musl-x64](https://aka.ms/dotnet-dump/linux-musl-x64) \| [musl-arm64](https://aka.ms/dotnet-dump/linux-musl-arm64) |

> [!NOTE]
> To use `dotnet-dump` on an x86 app, you need a corresponding x86 version of the tool.

## Synopsis

```console
Expand Down Expand Up @@ -108,6 +111,12 @@ dotnet-dump collect [-h|--help] [-p|--process-id] [-n|--name] [--type] [-o|--out

Enables dump collection diagnostic logging.

> [!NOTE]
> On Linux and macOS, this command expects the target application and `dotnet-dump` to share the same `TMPDIR` environment variable. Otherwise, the command will time out.

> [!NOTE]
> To collect a dump using `dotnet-dump`, it needs to be run as the same user as the user running target process or as root. Otherwise, the tool will fail to establish a connection with the target process.

## dotnet-dump analyze

Starts an interactive shell to explore a dump. The shell accepts various [SOS commands](#analyze-sos-commands).
Expand Down
9 changes: 9 additions & 0 deletions docs/core/diagnostics/dotnet-gcdump.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ There are two ways to download and install `dotnet-gcdump`:
| macOS | [x64](https://aka.ms/dotnet-gcdump/osx-x64) |
| Linux | [x64](https://aka.ms/dotnet-gcdump/linux-x64) \| [arm](https://aka.ms/dotnet-gcdump/linux-arm) \| [arm64](https://aka.ms/dotnet-gcdump/linux-arm64) \| [musl-x64](https://aka.ms/dotnet-gcdump/linux-musl-x64) \| [musl-arm64](https://aka.ms/dotnet-gcdump/linux-musl-arm64) |

> [!NOTE]
> To use `dotnet-gcdump` on an x86 app, you need a corresponding x86 version of the tool.

## Synopsis

```console
Expand Down Expand Up @@ -98,6 +101,12 @@ dotnet-gcdump collect [-h|--help] [-p|--process-id <pid>] [-o|--output <gcdump-f

The name of the process to collect the GC dump from.

> [!NOTE]
> On Linux and macOS, this command expects the target application and `dotnet-gcdump` to share the same `TMPDIR` environment variable. Otherwise, the command will time out.

> [!NOTE]
> To collect a GC dump using `dotnet-gcdump`, it needs to be run as the same user as the user running target process or as root. Otherwise, the tool will fail to establish a connection with the target process.

## `dotnet-gcdump ps`

Lists the dotnet processes that GC dumps can be collected for.
Expand Down
9 changes: 9 additions & 0 deletions docs/core/diagnostics/dotnet-trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ There are two ways to download and install `dotnet-trace`:
| macOS | [x64](https://aka.ms/dotnet-trace/osx-x64) |
| Linux | [x64](https://aka.ms/dotnet-trace/linux-x64) \| [arm](https://aka.ms/dotnet-trace/linux-arm) \| [arm64](https://aka.ms/dotnet-trace/linux-arm64) \| [musl-x64](https://aka.ms/dotnet-trace/linux-musl-x64) \| [musl-arm64](https://aka.ms/dotnet-trace/linux-musl-arm64) |

> [!NOTE]
> To use `dotnet-trace` on an x86 app, you need a corresponding x86 version of the tool.

## Synopsis

```console
Expand Down Expand Up @@ -141,6 +144,12 @@ dotnet-trace collect [--buffersize <size>] [--clreventlevel <clreventlevel>] [--
> [!NOTE]
> Stopping the trace may take a long time (up to minutes) for large applications. The runtime needs to send over the type cache for all managed code that was captured in the trace.

> [!NOTE]
> On Linux and macOS, this command expects the target application and `dotnet-trace` to share the same `TMPDIR` environment variable. Otherwise, the command will time out.

> [!NOTE]
> To collect a trace using `dotnet-trace`, it needs to be run as the same user as the user running target process or as root. Otherwise, the tool will fail to establish a connection with the target process.

## dotnet-trace convert

Converts `nettrace` traces to alternate formats for use with alternate trace analysis tools.
Expand Down