Skip to content

Commit 75b52ee

Browse files
committed
perf: subscribe only to necessary CLR events
1 parent bb10659 commit 75b52ee

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Sentry.Profiling/SampleProfilerSession.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ private SampleProfilerSession(SentryStopwatch stopwatch, EventPipeSession sessio
3030
// Exposed only for benchmarks.
3131
internal static EventPipeProvider[] Providers = new[]
3232
{
33-
// Note: all events we need issued by "DotNETRuntime" provider are at "EventLevel.Informational"
34-
// see https://learn.microsoft.com/en-us/dotnet/fundamentals/diagnostics/runtime-events
35-
// TODO replace Keywords.Default with a subset. Currently it is:
36-
// Default = GC | Type | GCHeapSurvivalAndMovement | Binder | Loader | Jit | NGen | SupressNGen
37-
// | StopEnumeration | Security | AppDomainResourceManagement | Exception | Threading | Contention | Stack | JittedMethodILToNativeMap
38-
// | ThreadTransfer | GCHeapAndTypeNames | Codesymbols | Compilation,
39-
new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Informational, (long) ClrTraceEventParser.Keywords.Default),
33+
new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Verbose, (long) (
34+
ClrTraceEventParser.Keywords.Jit
35+
| ClrTraceEventParser.Keywords.NGen
36+
| ClrTraceEventParser.Keywords.Loader
37+
| ClrTraceEventParser.Keywords.Binder
38+
| ClrTraceEventParser.Keywords.JittedMethodILToNativeMap
39+
)),
4040
new EventPipeProvider(SampleProfilerTraceEventParser.ProviderName, EventLevel.Informational),
4141
// new EventPipeProvider(TplEtwProviderTraceEventParser.ProviderName, EventLevel.Informational, (long) TplEtwProviderTraceEventParser.Keywords.Default)
4242
};

0 commit comments

Comments
 (0)