From 154c42e4565ea0f9675fcfbb6018a72b52c19d18 Mon Sep 17 00:00:00 2001 From: JonasBa Date: Fri, 8 Nov 2024 15:10:22 -0500 Subject: [PATCH] ref(profiling) Fix electron crash --- packages/profiling-node/bindings/cpu_profiler.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/profiling-node/bindings/cpu_profiler.cc b/packages/profiling-node/bindings/cpu_profiler.cc index d51a1e747e93..458447e9ebc1 100644 --- a/packages/profiling-node/bindings/cpu_profiler.cc +++ b/packages/profiling-node/bindings/cpu_profiler.cc @@ -331,11 +331,12 @@ void SentryProfile::Start(Profiler *profiler) { started_at = uv_hrtime(); timestamp = timestamp_milliseconds(); + v8::CpuProfilingOptions options = v8::CpuProfilingOptions( + v8::CpuProfilingMode::kCallerLineNumbers, + v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval); + // Initialize the CPU Profiler - profiler->cpu_profiler->StartProfiling( - profile_title, - {v8::CpuProfilingMode::kCallerLineNumbers, - v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval}); + profiler->cpu_profiler->StartProfiling(profile_title, &options); // listen for memory sample ticks profiler->measurements_ticker.add_cpu_listener(id, cpu_sampler_cb);