Skip to content

Update Microsoft.Diagnostics.NETCore.Client docs #28262

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
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
105 changes: 102 additions & 3 deletions docs/core/diagnostics/microsoft-diagnostics-netcore-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,30 @@ public DiagnosticsClient
DumpType dumpType,
string dumpPath,
bool logDumpGeneration = false);

public async Task WriteDumpAsync(
DumpType dumpType,
string dumpPath,
bool logDumpGeneration,
CancellationToken token);

public void AttachProfiler(
TimeSpan attachTimeout,
Guid profilerGuid,
string profilerPath,
byte[] additionalData = null);

public void SetStartupProfiler(
Guid profilerGuid,
string profilerPath);

public void ResumeRuntime();

public void SetEnvironmentVariable(
string name,
string value);

public Dictionary<string, string> GetProcessEnvironment();

public static IEnumerable<int> GetPublishedProcesses();
}
Expand All @@ -54,7 +72,7 @@ Creates a new instance of `DiagnosticsClient` for a compatible .NET process runn
public EventPipeSession StartEventPipeSession(
IEnumerable<EventPipeProvider> providers,
bool requestRundown = true,
int circularBufferMB = 256)
int circularBufferMB = 256);
```

Starts an EventPipe tracing session using the given providers and settings.
Expand All @@ -79,19 +97,58 @@ public EventPipeSession StartEventPipeSession(EventPipeProvider providers, bool
### WriteDump method

```csharp
public void WriteDump(DumpType dumpType, string dumpPath, bool logDumpGeneration=false);
public void WriteDump(
DumpType dumpType,
string dumpPath,
bool logDumpGeneration=false);
```

Request a dump for post-mortem debugging of the target application. The type of the dump can be specified using the [`DumpType`](#dumptype-enum) enum.

* `dumpType` : Type of the dump to be requested.
* `dumpPath` : The path to the dump to be written out to.
* `logDumpGeneration` : If set to `true`, the target application will write out diagnostic logs during dump generation.

```csharp
public void WriteDump(DumpType dumpType, string dumpPath, WriteDumpFlags flags)
```

Request a dump for post-mortem debugging of the target application. The type of the dump can be specified using the [`DumpType`](#dumptype-enum) enum.

* `dumpType` : Type of the dump to be requested.
* `dumpPath` : The path to the dump to be written out to.
* `flags` : logging and crash report flags. On runtimes less than 6.0, only LoggingEnabled is supported.

```csharp
public async Task WriteDumpAsync(DumpType dumpType, string dumpPath, bool logDumpGeneration, CancellationToken token)
```

Request a dump for post-mortem debugging of the target application. The type of the dump can be specified using the [`DumpType`](#dumptype-enum) enum.

* `dumpType` : Type of the dump to be requested.
* `dumpPath` : The path to the dump to be written out to.
* `logDumpGeneration` : If set to `true`, the target application will write out diagnostic logs during dump generation.
* `token` : The token to monitor for cancellation requests.

```csharp
public async Task WriteDumpAsync(DumpType dumpType, string dumpPath, WriteDumpFlags flags, CancellationToken token)
```

Request a dump for post-mortem debugging of the target application. The type of the dump can be specified using the [`DumpType`](#dumptype-enum) enum.

* `dumpType` : Type of the dump to be requested.
* `dumpPath` : The path to the dump to be written out to.
* `flags` : logging and crash report flags. On runtimes less than 6.0, only LoggingEnabled is supported.
* `token` : The token to monitor for cancellation requests.

### AttachProfiler method

```csharp
public void AttachProfiler(TimeSpan attachTimeout, Guid profilerGuid, string profilerPath, byte[] additionalData=null);
public void AttachProfiler(
TimeSpan attachTimeout,
Guid profilerGuid,
string profilerPath,
byte[] additionalData=null);
```

Request to attach an ICorProfiler to the target application.
Expand All @@ -101,6 +158,48 @@ Request to attach an ICorProfiler to the target application.
* `profilerPath` : Path to the ICorProfiler dll to be attached.
* `additionalData` : Optional additional data that can be passed to the runtime during profiler attach.

### SetStartupProfiler method

```csharp
public void SetStartupProfiler(
Guid profilerGuid,
string profilerPath);
```

Set a profiler as the startup profiler. It is only valid to issue this command while the runtime is paused at startup.

* `profilerGuid` : `Guid` for the profiler to be attached.
* `profilerPath` : Path to the profiler to be attached.

### ResumeRuntime method

```csharp
public void ResumeRuntime();
```

Tell the runtime to resume execution after being paused at startup.

### SetEnvironmentVariable method

```csharp
public void SetEnvironmentVariable(
string name,
string value);
```

Set an environment variable in the target process.

* `name` : The name of the environment variable to set.
* `value` : The value of the environment variable to set.

### GetProcessEnvironment

```csharp
public Dictionary<string, string> GetProcessEnvironment()
```

Gets all environment variables and their values from the target process.

### GetPublishedProcesses method

```csharp
Expand Down