From 75b52ee0f01b7e647e2fb3fa8b9ecfd5dea14d52 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 13 Feb 2025 18:59:19 +0100 Subject: [PATCH 1/3] perf: subscribe only to necessary CLR events --- src/Sentry.Profiling/SampleProfilerSession.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Sentry.Profiling/SampleProfilerSession.cs b/src/Sentry.Profiling/SampleProfilerSession.cs index 3bb606a960..396ea29489 100644 --- a/src/Sentry.Profiling/SampleProfilerSession.cs +++ b/src/Sentry.Profiling/SampleProfilerSession.cs @@ -30,13 +30,13 @@ private SampleProfilerSession(SentryStopwatch stopwatch, EventPipeSession sessio // Exposed only for benchmarks. internal static EventPipeProvider[] Providers = new[] { - // Note: all events we need issued by "DotNETRuntime" provider are at "EventLevel.Informational" - // see https://learn.microsoft.com/en-us/dotnet/fundamentals/diagnostics/runtime-events - // TODO replace Keywords.Default with a subset. Currently it is: - // Default = GC | Type | GCHeapSurvivalAndMovement | Binder | Loader | Jit | NGen | SupressNGen - // | StopEnumeration | Security | AppDomainResourceManagement | Exception | Threading | Contention | Stack | JittedMethodILToNativeMap - // | ThreadTransfer | GCHeapAndTypeNames | Codesymbols | Compilation, - new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Informational, (long) ClrTraceEventParser.Keywords.Default), + new EventPipeProvider(ClrTraceEventParser.ProviderName, EventLevel.Verbose, (long) ( + ClrTraceEventParser.Keywords.Jit + | ClrTraceEventParser.Keywords.NGen + | ClrTraceEventParser.Keywords.Loader + | ClrTraceEventParser.Keywords.Binder + | ClrTraceEventParser.Keywords.JittedMethodILToNativeMap + )), new EventPipeProvider(SampleProfilerTraceEventParser.ProviderName, EventLevel.Informational), // new EventPipeProvider(TplEtwProviderTraceEventParser.ProviderName, EventLevel.Informational, (long) TplEtwProviderTraceEventParser.Keywords.Default) }; From b3d72321ce5d06dacc64a80b2c9631b24bd8d1ac Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 13 Feb 2025 19:00:14 +0100 Subject: [PATCH 2/3] chore: changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49ac701258..0e2dedaa83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ - OperatingSystem will now return macOS as OS name instead of 'Darwin' as well as the proper version. ([#2710](https://github.com/getsentry/sentry-dotnet/pull/3956)) - Ignore null value on CocoaScopeObserver.SetTag ([#3948](https://github.com/getsentry/sentry-dotnet/pull/3948)) +### Enhancements + +- Profiling: improve performance by subscribing only to necessary CLR events ([#3970](https://github.com/getsentry/sentry-dotnet/pull/3970)) + ## 5.1.0 ### Significant change in behavior From 8708336e5d90dbac8e130a5dcb9ddb19347bfa9c Mon Sep 17 00:00:00 2001 From: Ivan Dlugos <6349682+vaind@users.noreply.github.com> Date: Sun, 9 Mar 2025 05:53:06 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc259a40c6..0103cf05e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Enhancements + +- Profiling: improve performance by subscribing only to necessary CLR events ([#3970](https://github.com/getsentry/sentry-dotnet/pull/3970)) + ### Fixes - Unknown stack frames in profiles on .NET 8+ ([#3967](https://github.com/getsentry/sentry-dotnet/pull/3967)) @@ -58,10 +62,6 @@ - OperatingSystem will now return macOS as OS name instead of 'Darwin' as well as the proper version. ([#2710](https://github.com/getsentry/sentry-dotnet/pull/3956)) - Ignore null value on CocoaScopeObserver.SetTag ([#3948](https://github.com/getsentry/sentry-dotnet/pull/3948)) -### Enhancements - -- Profiling: improve performance by subscribing only to necessary CLR events ([#3970](https://github.com/getsentry/sentry-dotnet/pull/3970)) - ## 5.1.0 ### Significant change in behavior