Skip to content

Commit 1fe0561

Browse files
mdh1418noahfalk
andauthored
[EventSource] Clarify limitations of self-describing event format (#45869)
* [EventSource] Clarify limitations of self-describing event format * Adjust EventAttribute metadata clarification Co-authored-by: Noah Falk <[email protected]> --------- Co-authored-by: Noah Falk <[email protected]>
1 parent de5fe14 commit 1fe0561

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/fundamentals/runtime-libraries/system-diagnostics-tracing-eventsource.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Historically, these two formats are derived from two formats that Event Tracing
3535

3636
The default event format is <xref:System.Diagnostics.Tracing.EventSourceSettings.EtwManifestEventFormat>, which is set if not specified on <xref:System.Diagnostics.Tracing.EventSourceSettings>. Manifest-based <xref:System.Diagnostics.Tracing.EventSource> objects generate an XML document representing the events defined on the class upon initialization. This requires the <xref:System.Diagnostics.Tracing.EventSource> to reflect over itself to generate the provider and event metadata.
3737

38-
To use self-describing (tracelogging) event format, construct your <xref:System.Diagnostics.Tracing.EventSource> using the <xref:System.Diagnostics.Tracing.EventSource.%23ctor(System.String)> constructor, the <xref:System.Diagnostics.Tracing.EventSource.%23ctor(System.String,System.Diagnostics.Tracing.EventSourceSettings)> constructor, or by setting the `EtwSelfDescribingEventFormat` flag on <xref:System.Diagnostics.Tracing.EventSourceSettings>. Self-describing sources generate minimal provider metadata on initialization and only generate event metadata when <xref:System.Diagnostics.Tracing.EventSource.Write(System.String)> is called.
38+
To use self-describing (tracelogging) event format, construct your <xref:System.Diagnostics.Tracing.EventSource> using the <xref:System.Diagnostics.Tracing.EventSource.%23ctor(System.String)> constructor, the <xref:System.Diagnostics.Tracing.EventSource.%23ctor(System.String,System.Diagnostics.Tracing.EventSourceSettings)> constructor, or by setting the `EtwSelfDescribingEventFormat` flag on <xref:System.Diagnostics.Tracing.EventSourceSettings>. Self-describing sources generate minimal provider metadata on initialization and only generate event metadata when <xref:System.Diagnostics.Tracing.EventSource.Write(System.String)> is called. Unlike the manifest-based format, when listening via ETW only the Level, Keyword, and Opcode metadata are included from the <xref:System.Diagnostics.Tracing.EventAttribute> attribute. Other properties such as EventId or Message are not included.
3939

4040
In practice, these event format settings only affect usage with readers based on Event Tracing for Windows (ETW). They can, however, have a small effect on initialization time and per-event write times due to the time required for reflection and generating the metadata.
4141

0 commit comments

Comments
 (0)