-
Notifications
You must be signed in to change notification settings - Fork 6
Description
In addition to provider id, keyword and level, ETW/EventPipe/EventSource all have a 4th kind of configuration data called arguments or filter arguments. For EventPipe this is a string that encodes arbitrary key-value pairs can be interpretted by a given provider. For example the LoggingEventSource uses arguments to encode a nested set of ILogger filters to determine which ILogger log messages should get emitted as EventSource events. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-9.0#event-source
For EventPipe in particular arguments are specified using the "arguments" field of the streaming_provider_config documented here: https://github.com/dotnet/diagnostics/blob/main/documentation/design-docs/ipc-protocol.md#collecttracing5
The minimal request is to support passing an arbitrary arguments string when enabling .NET events with a record-trace script. For example perhaps arguments are a new parameter to the event_from_dotnet() function:
let event = event_from_dotnet(
"SomeProviderName",
0x0, 4, "ArbitraryArgumentsStringGoesHere", 3, "EventName");
The more generalized request that could be part of this work item or a separate work item is to support enabling events on a provider by only specifying provider name, keywords, level, and arguments. The event names and IDs are never enumerated and can't necessarily be predicted in advance. We can decide on any appropriate script API but one example might be:
let scenario = new_dotnet_scenario();
scenario.enable_provider("SomeProviderName",
0x0, // keywords
4, // level
"ArbitraryArgumentsStringGoesHere");
use_dotnet_scenario(scenario);