Add ability to set provider group

This commit is contained in:
Kyle Wojtaszek
2021-01-27 13:12:37 -08:00
parent d1ffc52c73
commit 30844eed75
3 changed files with 111 additions and 3 deletions
+7 -1
View File
@@ -120,7 +120,13 @@ func providerIDFromName(name string) guid.GUID {
// NewProvider creates and registers a new ETW provider. The provider ID is
// generated based on the provider name.
func NewProvider(name string, callback EnableCallback) (provider *Provider, err error) {
return NewProviderWithID(name, providerIDFromName(name), callback)
return NewProviderWithOptions(name, WithCallback(callback))
}
// NewProviderWithGroup creates and registers a new ETW provider with a
// specificed group. The provider ID is generated based on the provider name.
func NewProviderWithGroup(name string, group guid.GUID, callback EnableCallback) (provider *Provider, err error) {
return NewProviderWithOptions(name, WithGroup(group), WithCallback(callback))
}
// Close unregisters the provider.