dotnet / diagnostics

This repository contains the source code for various .NET Core runtime diagnostic tools and documents.
MIT License
1.19k stars 356 forks source link

Expose DiagnosticsClient.GetProcessInfo #1991

Open ronbrogan opened 3 years ago

ronbrogan commented 3 years ago

Background and Motivation

In order to correctly choose the relevant profiler DLL to attach to the process, you need to determine the process architecture. In .NET 5, the ProcessInfo API (https://github.com/dotnet/diagnostics/blob/master/documentation/design-docs/ipc-protocol.md#processinfo) was introduced, and can be used for this purpose.

DiagnosticsClient implements this method, however it's currently internal - thus unusable by consumers. https://github.com/dotnet/diagnostics/blob/1d0b2be78e0bca39f139af8596abaebef5b312fe/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/DiagnosticsClient.cs#L195

What's the motivation for keeping this API internal? Would a pull request in this area be welcome?

sywhang commented 3 years ago

@ronbrogan Thanks for bringing this up. The reason this API (along with a few other APIs) is currently marked as internal is because we weren't sure if we're happy with these API design as they are now, and we wanted to ship a few new features in the CLI tools that make use of them.

We're planning on doing a new API design spec for the diagnostics client API in the upcoming weeks so please keep an eye out on that.