[sgen] DTrace probes for world stop/restart.
authorMark Probst <mark.probst@gmail.com>
Mon, 5 Nov 2012 11:08:41 +0000 (12:08 +0100)
committerMark Probst <mark.probst@gmail.com>
Sun, 9 Dec 2012 14:02:46 +0000 (15:02 +0100)
data/mono.d
mono/metadata/sgen-stw.c

index e2f4153beffb7da57d8f33c743b8d80ddbe9e676..34daae60de3f8e2c88891dd5d06d28972953353e 100644 (file)
@@ -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);
 
index 0e870e97c8dfdaa62521457374bd66e551c05917..1a845c91e9552b6574726c11e27abdb3875e8102 100644 (file)
@@ -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);