Skip to content

Commit c82add5

Browse files
committed
ref(profiling) Fix electron crash
1 parent a91a5ba commit c82add5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/profiling-node/bindings/cpu_profiler.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,8 @@ void SentryProfile::Start(Profiler *profiler) {
333333

334334
// Initialize the CPU Profiler
335335
profiler->cpu_profiler->StartProfiling(
336-
profile_title,
337-
{v8::CpuProfilingMode::kCallerLineNumbers,
338-
v8::CpuProfilingOptions::kNoSampleLimit, kSamplingInterval});
336+
profile_title, v8::CpuProfilingMode::kCallerLineNumbers, true,
337+
v8::CpuProfilingOptions::kNoSampleLimit);
339338

340339
// listen for memory sample ticks
341340
profiler->measurements_ticker.add_cpu_listener(id, cpu_sampler_cb);
@@ -1169,6 +1168,7 @@ napi_value Init(napi_env env, napi_value exports) {
11691168
}
11701169

11711170
Profiler *profiler = new Profiler(env, isolate);
1171+
profiler->cpu_profiler->SetSamplingInterval(kSamplingInterval);
11721172

11731173
if (napi_set_instance_data(env, profiler, FreeAddonData, NULL) != napi_ok) {
11741174
napi_throw_error(env, nullptr, "Failed to set instance data for profiler.");

0 commit comments

Comments
 (0)