Skip to content

Commit b812080

Browse files
authored
[browser] profiler cleanup (#114480)
1 parent aa458fa commit b812080

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/mono/mono/eventpipe/ep-rt-mono-runtime-provider.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,24 +1478,29 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method, MonoObject *exc)
14781478
sample_current_thread_stack_trace ();
14791479
}
14801480

1481+
#ifdef HOST_BROWSER
14811482
MonoProfilerHandle mono_profiler_init_browser_eventpipe (void);
14821483
void mono_profiler_fini_browser_eventpipe (void);
1483-
1484+
#endif
14841485

14851486
void
14861487
ep_rt_mono_sampling_provider_component_init (void)
14871488
{
1489+
#ifdef HOST_BROWSER
14881490
// in single-threaded mode, we install instrumentation callbacks on the mono profiler, instead of stop-the-world
14891491
// this has negative performance impact even when the EP client is not connected!
14901492
// but it has to be enabled before managed code starts running, because the instrumentation needs to be in place
14911493
_ep_rt_mono_sampling_profiler_provider = mono_profiler_init_browser_eventpipe ();
1494+
#endif
14921495
}
14931496

14941497
void
14951498
ep_rt_mono_sampling_provider_component_fini (void)
14961499
{
14971500
EP_ASSERT (_ep_rt_mono_sampling_profiler_provider != NULL);
1501+
#ifdef HOST_BROWSER
14981502
mono_profiler_fini_browser_eventpipe ();
1503+
#endif
14991504
}
15001505

15011506
void

0 commit comments

Comments
 (0)