Skip to content

Commit cc3f8fa

Browse files
authored
Improve docs for WasmPerfInstrumentation (#35434)
1 parent fbed1d3 commit cc3f8fa

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

aspnetcore/blazor/performance/webassembly-event-pipe-diagnostics.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,25 @@ The MSBuild properties in the following table enable profiler integration.
4141

4242
Property | Default | Set value to… | Description
4343
--- | :---: | :---: | ---
44-
`<WasmPerfTracing>` | `false` | `true` | Controls diagnostic server tracing.
45-
`<MetricsSupport>` | `false` | `true` | Controls `System.Diagnostics.Metrics` support. For more information, see the [`System.Diagnostics.Metrics` namespace](/dotnet/api/system.diagnostics.metrics).
46-
`<EventSourceSupport>` | `false`| `true` | Controls `EventPipe` support. For more information, see [Diagnostics and instrumentation: Observability and telemetry](/dotnet/core/deploying/native-aot/diagnostics#observability-and-telemetry).
47-
48-
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:BlazorSampleProfilingEnabled=true` (.NET CLI) or `<BlazorSampleProfilingEnabled>true</BlazorSampleProfilingEnabled>` in a Visual Studio publish profile, where "`BlazorSampleProfilingEnabled`" is a custom symbol name that you choose and doesn't conflict with other symbol names.
44+
`<WasmPerfTracing>` | `false` | `true` | Enables support for WebAssembly performance tracing.
45+
`<WasmPerfInstrumentation>` | No value | See table&dagger; | Enables instrumentation necessary for the sampling profiler. The property follows the :::no-loc text="callspec"::: syntax. &dagger;For permissible values, see the following table.
46+
`<MetricsSupport>` | `false` | `true` | Enables `System.Diagnostics.Metrics` support. For more information, see the [`System.Diagnostics.Metrics` namespace](/dotnet/api/system.diagnostics.metrics).
47+
`<EventSourceSupport>` | `false`| `true` | Enables `EventPipe` support. For more information, see [Diagnostics and instrumentation: Observability and telemetry](/dotnet/core/deploying/native-aot/diagnostics#observability-and-telemetry).
48+
49+
The following table describes permissable `<WasmPerfInstrumentation>` values.
50+
51+
`<WasmPerfInstrumentation>` value | Description
52+
--- | ---
53+
`all` | All assemblies
54+
`program` | Entry point assembly
55+
`{ASSEMBLY}` | Specifies an assembly (`{ASSEMBLY}`)
56+
`M:Type:{METHOD}` | Specifies a method (`{METHOD}`)
57+
`N:{NAMESPACE}` | Specifies a namespace (`{NAMESPACE}`)
58+
`T:{TYPE}` | Specifies a type (`{TYPE}`)
59+
`+EXPR` | Includes expression
60+
`-EXPR` | Excludes expression
61+
62+
Enabling profilers has negative size and performance impacts, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:BlazorSampleProfilingEnabled=true` (.NET CLI) or `<BlazorSampleProfilingEnabled>true</BlazorSampleProfilingEnabled>` in a Visual Studio publish profile, where "`BlazorSampleProfilingEnabled`" is a custom symbol name that you choose and doesn't conflict with other symbol names.
4963

5064
In the app's project file (`.csproj`):
5165

@@ -60,7 +74,7 @@ In the app's project file (`.csproj`):
6074
Alternatively, enable features when the app is built with the .NET CLI. The following options passed to the `dotnet build` command mirror the preceding MS Build property configuration:
6175

6276
```dotnetcli
63-
/p:WasmPerfTracing=true /p:WasmPerfInstrumentation=true /p:MetricsSupport=true /p:EventSourceSupport=true
77+
/p:WasmPerfTracing=true /p:WasmPerfInstrumentation=all /p:MetricsSupport=true /p:EventSourceSupport=true
6478
```
6579

6680
The [`Timing-Allow-Origin` HTTP header](https://developer.mozilla.org/docs/Web/HTTP/Reference/Headers/Timing-Allow-Origin) allows for more precise time measurements.
@@ -69,13 +83,13 @@ The [`Timing-Allow-Origin` HTTP header](https://developer.mozilla.org/docs/Web/H
6983

7084
[EventPipe](/dotnet/core/diagnostics/eventpipe) is a runtime component used to collect tracing data, similar to [ETW](/windows/win32/etw/event-tracing-portal) and [perf_events](https://wikipedia.org/wiki/Perf_%28Linux%29).
7185

72-
Use the `<WasmPerfInstrumentation>` property to enable CPU sampling instrumentation for diagnostic server. This setting isn't necessary for memory dump or counters. **Makes the app execute slower. Only set this to `true` for performance profiling.**
86+
Use the `<WasmPerfInstrumentation>` property to enable CPU sampling instrumentation for diagnostic server. This setting isn't necessary for memory dump or counters. **Makes the app execute slower. Only enable this for performance profiling.**
7387

7488
Enabling profilers has negative size and performance impact, so don't publish an app for production with profilers enabled. In the following example, a condition is set on a property group section that only enables profiling when the app is built with `/p:BlazorSampleProfilingEnabled=true` (.NET CLI) or `<BlazorSampleProfilingEnabled>true</BlazorSampleProfilingEnabled>` in a Visual Studio publish profile, where "`BlazorSampleProfilingEnabled`" is a custom symbol name that you choose and doesn't conflict with other symbol names.
7589

7690
```xml
7791
<PropertyGroup Condition="'$(BlazorSampleProfilingEnabled)' == 'true'">
78-
<WasmPerfInstrumentation>true</WasmPerfInstrumentation>
92+
<WasmPerfInstrumentation>all</WasmPerfInstrumentation>
7993
</PropertyGroup>
8094
```
8195

0 commit comments

Comments
 (0)