From 0654f84b19c48b3455586cbbbaaac1cd81cbee16 Mon Sep 17 00:00:00 2001 From: Mark Probst Date: Mon, 5 Nov 2012 12:08:41 +0100 Subject: [PATCH] [sgen] DTrace probes for world stop/restart. --- data/mono.d | 5 +++++ mono/metadata/sgen-stw.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/data/mono.d b/data/mono.d index e2f4153beff..34daae60de3 100644 --- a/data/mono.d +++ b/data/mono.d @@ -19,6 +19,11 @@ provider mono { probe gc__begin (int generation); probe gc__end (int generation); + probe gc__world__stop__begin (); + probe gc__world__stop__end (); + probe gc__world__restart__begin (); + probe gc__world__restart__end (); + probe gc__heap__alloc (uintptr_t addr, uintptr_t len); probe gc__heap__free (uintptr_t addr, uintptr_t len); diff --git a/mono/metadata/sgen-stw.c b/mono/metadata/sgen-stw.c index 0e870e97c8d..1a845c91e95 100644 --- a/mono/metadata/sgen-stw.c +++ b/mono/metadata/sgen-stw.c @@ -214,6 +214,7 @@ sgen_stop_world (int generation) sgen_process_togglerefs (); mono_profiler_gc_event (MONO_GC_EVENT_PRE_STOP_WORLD, generation); + MONO_GC_WORLD_STOP_BEGIN (); acquire_gc_locks (); update_current_thread_stack (&count); @@ -229,6 +230,7 @@ sgen_stop_world (int generation) SGEN_LOG (3, "world stopped %d thread(s)", count); mono_profiler_gc_event (MONO_GC_EVENT_POST_STOP_WORLD, generation); + MONO_GC_WORLD_STOP_END (); sgen_memgov_collection_start (generation); @@ -249,6 +251,7 @@ sgen_restart_world (int generation, GGTimingInfo *timing) if (G_UNLIKELY (mono_profiler_events & MONO_PROFILE_GC_MOVES)) sgen_gc_event_moves (); mono_profiler_gc_event (MONO_GC_EVENT_PRE_START_WORLD, generation); + MONO_GC_WORLD_RESTART_BEGIN (); FOREACH_THREAD (info) { info->stack_start = NULL; #ifdef USE_MONO_CTX @@ -267,6 +270,7 @@ sgen_restart_world (int generation, GGTimingInfo *timing) max_pause_usec = MAX (usec, max_pause_usec); SGEN_LOG (2, "restarted %d thread(s) (pause time: %d usec, max: %d)", count, (int)usec, (int)max_pause_usec); mono_profiler_gc_event (MONO_GC_EVENT_POST_START_WORLD, generation); + MONO_GC_WORLD_RESTART_END (); bridge_process (generation); -- 2.25.1