[sgen] DTrace probes for sweep begin/end and concurrent start/finish begin/end.
authorMark Probst <mark.probst@gmail.com>
Wed, 7 Nov 2012 16:06:43 +0000 (17:06 +0100)
committerMark Probst <mark.probst@gmail.com>
Sun, 9 Dec 2012 14:02:47 +0000 (15:02 +0100)
data/mono.d
mono/metadata/sgen-gc.c
mono/metadata/sgen-protocol.h

index 34daae60de3f8e2c88891dd5d06d28972953353e..76721151289f4f091c13303179e90a6cc71d5a78 100644 (file)
@@ -19,6 +19,15 @@ provider mono {
        probe gc__begin (int generation);
        probe gc__end (int generation);
 
+       probe gc__concurrent__start__begin (int generation);
+       probe gc__concurrent__start__end (int generation);
+       probe gc__concurrent__update__finish__begin (int generation);
+       probe gc__concurrent__update__end (int generation);
+       probe gc__concurrent__finish__end (int generation);
+
+       probe gc__sweep__begin (int generation);
+       probe gc__sweep__end (int generation);
+
        probe gc__world__stop__begin ();
        probe gc__world__stop__end ();
        probe gc__world__restart__begin ();
index 181311e9ba587aed2e1ccd44e37d88538401104d..266b2e79ecc10f5a29daaaed325cf6adfc1fa426 100644 (file)
@@ -2956,6 +2956,8 @@ major_finish_collection (const char *reason, int old_next_pin_slot, gboolean sca
        reset_heap_boundaries ();
        sgen_update_heap_boundaries ((mword)sgen_get_nursery_start (), (mword)sgen_get_nursery_end ());
 
+       MONO_GC_SWEEP_BEGIN (GENERATION_OLD);
+
        /* sweep the big objects list */
        prevbo = NULL;
        for (bigobj = los_object_list; bigobj;) {
@@ -2989,6 +2991,8 @@ major_finish_collection (const char *reason, int old_next_pin_slot, gboolean sca
 
        major_collector.sweep ();
 
+       MONO_GC_SWEEP_END (GENERATION_OLD);
+
        TV_GETTIME (btv);
        time_major_sweep += TV_ELAPSED (atv, btv);
 
@@ -3064,6 +3068,8 @@ static gboolean major_do_collection (const char *reason);
 static void
 major_start_concurrent_collection (const char *reason)
 {
+       MONO_GC_CONCURRENT_START_BEGIN (GENERATION_OLD);
+
        // FIXME: store reason and pass it when finishing
        major_start_collection (NULL);
 
@@ -3072,16 +3078,22 @@ major_start_concurrent_collection (const char *reason)
 
        sgen_workers_wait_for_jobs ();
 
+       MONO_GC_CONCURRENT_START_END (GENERATION_OLD);
+
        current_collection_generation = -1;
 }
 
 static gboolean
 major_update_or_finish_concurrent_collection (void)
 {
+       MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD);
+
        major_collector.update_cardtable_mod_union ();
        sgen_los_update_cardtable_mod_union ();
 
        if (!sgen_workers_all_done ()) {
+               MONO_GC_CONCURRENT_UPDATE_END (GENERATION_OLD);
+
                g_print ("workers not done\n");
                return FALSE;
        }
@@ -3090,6 +3102,9 @@ major_update_or_finish_concurrent_collection (void)
 
        current_collection_generation = GENERATION_OLD;
        major_finish_collection ("finishing", -1, TRUE);
+
+       MONO_GC_CONCURRENT_FINISH_END (GENERATION_OLD);
+
        current_collection_generation = -1;
 
        if (whole_heap_check_before_collection)
index 2f2420d2ad1af64c06d132d18c9994eff33c870b..96355505da29c6ca36b2274d39160dd1817994b3 100644 (file)
@@ -162,7 +162,8 @@ void binary_protocol_missing_remset (gpointer obj, gpointer obj_vtable, int offs
 #define binary_protocol_is_enabled()   FALSE
 
 #define binary_protocol_flush_buffers(force)
-#define binary_protocol_collection(index, generation)
+#define binary_protocol_collection_begin(index, generation)
+#define binary_protocol_collection_end(index, generation)
 #define binary_protocol_alloc(obj, vtable, size)
 #define binary_protocol_alloc_pinned(obj, vtable, size)
 #define binary_protocol_alloc_degraded(obj, vtable, size)