From: Mark Probst Date: Wed, 7 Nov 2012 16:06:43 +0000 (+0100) Subject: [sgen] DTrace probes for sweep begin/end and concurrent start/finish begin/end. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;ds=sidebyside;h=bd5b216df955ac8f6ad7b465cbcb53fd4ef78e1c;p=mono.git [sgen] DTrace probes for sweep begin/end and concurrent start/finish begin/end. --- diff --git a/data/mono.d b/data/mono.d index 34daae60de3..76721151289 100644 --- a/data/mono.d +++ b/data/mono.d @@ -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 (); diff --git a/mono/metadata/sgen-gc.c b/mono/metadata/sgen-gc.c index 181311e9ba5..266b2e79ecc 100644 --- a/mono/metadata/sgen-gc.c +++ b/mono/metadata/sgen-gc.c @@ -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) diff --git a/mono/metadata/sgen-protocol.h b/mono/metadata/sgen-protocol.h index 2f2420d2ad1..96355505da2 100644 --- a/mono/metadata/sgen-protocol.h +++ b/mono/metadata/sgen-protocol.h @@ -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)