[sgen] Move DTrace support to Mono-specific code.
authorMark Probst <mark.probst@gmail.com>
Sun, 28 Dec 2014 02:45:12 +0000 (18:45 -0800)
committerMark Probst <mark.probst@gmail.com>
Wed, 29 Apr 2015 17:57:51 +0000 (10:57 -0700)
We use client callbacks from the binary protocol functions.  There are some DTrace probes
which we don't have binary protocol entries for.  Since DTrace isn't properly supported
anyway (and doesn't even work as it should on OSX), we just remove those probes instead
of making new binary protocol entries.

19 files changed:
data/mono.d
mono/metadata/sgen-alloc.c
mono/metadata/sgen-client-mono.h
mono/metadata/sgen-client.h
mono/metadata/sgen-copy-object.h
mono/metadata/sgen-fin-weak-hash.c
mono/metadata/sgen-gc.c
mono/metadata/sgen-gc.h
mono/metadata/sgen-internal.c
mono/metadata/sgen-marksweep.c
mono/metadata/sgen-memory-governor.c
mono/metadata/sgen-mono.c
mono/metadata/sgen-nursery-allocator.c
mono/metadata/sgen-pinning.c
mono/metadata/sgen-protocol-def.h
mono/metadata/sgen-protocol.c
mono/metadata/sgen-protocol.h
mono/metadata/sgen-stw.c
mono/utils/dtrace.h

index dae3c397d0ed200d87adf97af68f4640e72b9991..69f46525c7b0403d1ed6f835f99d7344242abe42 100644 (file)
@@ -21,21 +21,8 @@ provider mono {
 
        probe gc__requested (int generation, uintptr_t requested_size, int wait_to_finish);
 
-       probe gc__checkpoint__1 (int generation);
-       probe gc__checkpoint__2 (int generation);
-       probe gc__checkpoint__3 (int generation);
-       probe gc__checkpoint__4 (int generation);
-       probe gc__checkpoint__5 (int generation);
-       probe gc__checkpoint__6 (int generation);
-       probe gc__checkpoint__7 (int generation);
-       probe gc__checkpoint__8 (int generation);
-       probe gc__checkpoint__9 (int generation);
-
        probe gc__concurrent__start__begin (int generation);
-       probe gc__concurrent__start__end (int generation, long long num_major_objects_marked);
        probe gc__concurrent__update__finish__begin (int generation, long long num_major_objects_marked);
-       probe gc__concurrent__update__end (int generation, long long num_major_objects_marked);
-       probe gc__concurrent__finish__end (int generation, long long num_major_objects_marked);
 
        probe gc__sweep__begin (int generation, int full_sweep);
        probe gc__sweep__end (int generation, int full_sweep);
@@ -45,19 +32,12 @@ provider mono {
        probe gc__world__restart__begin (int generation);
        probe gc__world__restart__end (int generation);
 
-       probe gc__heap__alloc (uintptr_t addr, uintptr_t len);
-       probe gc__heap__free (uintptr_t addr, uintptr_t len);
-
-       probe gc__locked ();
-       probe gc__unlocked ();
-
        probe gc__nursery__tlab__alloc (uintptr_t addr, uintptr_t len);
        probe gc__nursery__obj__alloc (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
 
        probe gc__major__obj__alloc__large (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
        probe gc__major__obj__alloc__pinned (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
        probe gc__major__obj__alloc__degraded (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
-       probe gc__major__obj__alloc__mature (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
 
        /* Can be nursery->nursery, nursery->major or major->major */
        probe gc__obj__moved (uintptr_t dest, uintptr_t src, int dest_gen, int src_gen, uintptr_t size, char *ns_name, char *class_name);
@@ -70,13 +50,10 @@ provider mono {
        probe gc__finalize__enqueue (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name, int generation, int is_critical);
        probe gc__finalize__invoke (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
 
-       probe gc__weak__update (uintptr_t ref_addr, uintptr_t old_addr, uintptr_t new_addr, uintptr_t size, char *ns_name, char *class_name, int track);
+       probe gc__weak__update (uintptr_t ref_addr, uintptr_t new_addr, uintptr_t size, char *ns_name, char *class_name, int track);
 
        probe gc__global__remset__add (uintptr_t ref_addr, uintptr_t obj_addr, uintptr_t size, char *ns_name, char *class_name);
        probe gc__obj__cemented (uintptr_t addr, uintptr_t size, char *ns_name, char *class_name);
-
-       probe gc__internal__alloc (uintptr_t addr, uintptr_t size, int type);
-       probe gc__internal__dealloc (uintptr_t add, uintptr_t size, int type);
 };
 
 #pragma D attributes Evolving/Evolving/Common provider mono provider
index 09393fc0f9dcb830f37e235cab58ee79ded38718..032493f332300ddd3cc8cb24b183e641b36cf7a3 100644 (file)
@@ -119,12 +119,8 @@ alloc_degraded (GCVTable *vtable, size_t size, gboolean for_mature)
 
        p = major_collector.alloc_degraded (vtable, size);
 
-       if (for_mature) {
-               MONO_GC_MAJOR_OBJ_ALLOC_MATURE ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
-       } else {
+       if (!for_mature)
                binary_protocol_alloc_degraded (p, vtable, size);
-               MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
-       }
 
        return p;
 }
@@ -229,8 +225,6 @@ sgen_alloc_obj_nolock (GCVTable *vtable, size_t size)
                        CANARIFY_ALLOC(p,real_size);
                        SGEN_LOG (6, "Allocated object %p, vtable: %p (%s), size: %zd", p, vtable, sgen_client_vtable_get_name (vtable), size);
                        binary_protocol_alloc (p , vtable, size);
-                       if (G_UNLIKELY (MONO_GC_NURSERY_OBJ_ALLOC_ENABLED ()))
-                               MONO_GC_NURSERY_OBJ_ALLOC ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
                        g_assert (*p == NULL);
                        mono_atomic_store_seq (p, vtable);
 
@@ -338,12 +332,6 @@ sgen_alloc_obj_nolock (GCVTable *vtable, size_t size)
        if (G_LIKELY (p)) {
                SGEN_LOG (6, "Allocated object %p, vtable: %p (%s), size: %zd", p, vtable, sgen_client_vtable_get_name (vtable), size);
                binary_protocol_alloc (p, vtable, size);
-               if (G_UNLIKELY (MONO_GC_MAJOR_OBJ_ALLOC_LARGE_ENABLED ()|| MONO_GC_NURSERY_OBJ_ALLOC_ENABLED ())) {
-                       if (real_size > SGEN_MAX_SMALL_OBJ_SIZE)
-                               MONO_GC_MAJOR_OBJ_ALLOC_LARGE ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
-                       else
-                               MONO_GC_NURSERY_OBJ_ALLOC ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
-               }
                mono_atomic_store_seq (p, vtable);
        }
 
@@ -422,8 +410,6 @@ sgen_try_alloc_obj_nolock (GCVTable *vtable, size_t size)
                        sgen_set_nursery_scan_start ((char*)p);
 
                        zero_tlab_if_necessary (new_next, alloc_size);
-
-                       MONO_GC_NURSERY_TLAB_ALLOC ((mword)new_next, alloc_size);
                }
        }
 
@@ -433,8 +419,6 @@ sgen_try_alloc_obj_nolock (GCVTable *vtable, size_t size)
        CANARIFY_ALLOC(p,real_size);
        SGEN_LOG (6, "Allocated object %p, vtable: %p (%s), size: %zd", p, vtable, sgen_client_vtable_get_name (vtable), size);
        binary_protocol_alloc (p, vtable, size);
-       if (G_UNLIKELY (MONO_GC_NURSERY_OBJ_ALLOC_ENABLED ()))
-               MONO_GC_NURSERY_OBJ_ALLOC ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
        g_assert (*p == NULL); /* FIXME disable this in non debug builds */
 
        mono_atomic_store_seq (p, vtable);
@@ -510,10 +494,6 @@ mono_gc_alloc_pinned_obj (MonoVTable *vtable, size_t size)
        }
        if (G_LIKELY (p)) {
                SGEN_LOG (6, "Allocated pinned object %p, vtable: %p (%s), size: %zd", p, vtable, sgen_client_vtable_get_name (vtable), size);
-               if (size > SGEN_MAX_SMALL_OBJ_SIZE)
-                       MONO_GC_MAJOR_OBJ_ALLOC_LARGE ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
-               else
-                       MONO_GC_MAJOR_OBJ_ALLOC_PINNED ((mword)p, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
                binary_protocol_alloc_pinned (p, vtable, size);
        }
        UNLOCK_GC;
index 3740c164c0d0c77da8aa039bc3eb85849eecb6a7..f1fc6851b4e4373f027e5a09dfe45c5a6e2d0fc7 100644 (file)
@@ -184,3 +184,150 @@ sgen_client_object_has_critical_finalizer (GCObject *obj)
 
        return mono_class_has_parent_fast (class, mono_defaults.critical_finalizer_object);
 }
+
+#ifndef ENABLE_DTRACE
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_collection_requested (int generation, size_t requested_size, gboolean force)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_collection_begin (int minor_gc_count, int generation)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_collection_end (int minor_gc_count, int generation, long long num_objects_scanned, long long num_unique_objects_scanned)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_concurrent_start (void)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_concurrent_update (void)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_concurrent_finish (void)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_sweep_begin (int generation, int full_sweep)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_sweep_end (int generation, int full_sweep)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_stopping (long long timestamp)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_stopped (long long timestamp, long long total_major_cards, long long marked_major_cards, long long total_los_cards, long long marked_los_cards)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_restarting (int generation, long long timestamp, long long total_major_cards, long long marked_major_cards, long long total_los_cards, long long marked_los_cards)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_world_restarted (int generation, long long timestamp)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_alloc (gpointer obj, gpointer vtable, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_alloc_degraded (gpointer obj, gpointer vtable, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_pin (gpointer obj, gpointer vtable, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_cement (gpointer ptr, gpointer vtable, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_copy (gpointer from, gpointer to, gpointer vtable, size_t size)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_global_remset (gpointer ptr, gpointer value, gpointer value_vtable)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_dislink_update (gpointer link, gpointer obj, gboolean track, gboolean staged)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_empty (gpointer start, size_t size)
+{
+}
+#endif
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_thread_suspend (gpointer thread, gpointer stopped_ip)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_thread_restart (gpointer thread)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_thread_register (gpointer thread)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_thread_unregister (gpointer thread)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_missing_remset (gpointer obj, gpointer obj_vtable, int offset, gpointer value, gpointer value_vtable, gboolean value_pinned)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_cement_reset (void)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_domain_unload_begin (gpointer domain)
+{
+}
+
+static void G_GNUC_UNUSED
+sgen_client_binary_protocol_domain_unload_end (gpointer domain)
+{
+}
index 86bc8b4e8b1f28f1db341ca17d5885991b514d25..6ec7d089111bbf6195d585dc83c695f228ed2d3d 100644 (file)
@@ -94,3 +94,58 @@ void sgen_client_pre_collection_checks (void);
 
 gboolean sgen_client_handle_gc_debug (const char *opt);
 void sgen_client_print_gc_debug_usage (void);
+
+#define TYPE_INT int
+#define TYPE_LONGLONG long long
+#define TYPE_SIZE size_t
+#define TYPE_POINTER gpointer
+#define TYPE_BOOL gboolean
+
+#define BEGIN_PROTOCOL_ENTRY0(method) \
+       void sgen_client_ ## method (void);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY0(method) \
+       void sgen_client_ ## method (void);
+#define BEGIN_PROTOCOL_ENTRY1(method,t1,f1) \
+       void sgen_client_ ## method (t1 f1);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY1(method,t1,f1) \
+       void sgen_client_ ## method (t1 f1);
+#define BEGIN_PROTOCOL_ENTRY2(method,t1,f1,t2,f2) \
+       void sgen_client_ ## method (t1 f1, t2 f2);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY2(method,t1,f1,t2,f2) \
+       void sgen_client_ ## method (t1 f1, t2 f2);
+#define BEGIN_PROTOCOL_ENTRY3(method,t1,f1,t2,f2,t3,f3) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY3(method,t1,f1,t2,f2,t3,f3) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3);
+#define BEGIN_PROTOCOL_ENTRY4(method,t1,f1,t2,f2,t3,f3,t4,f4) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3, t4 f4);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY4(method,t1,f1,t2,f2,t3,f3,t4,f4) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3, t4 f4);
+#define BEGIN_PROTOCOL_ENTRY5(method,t1,f1,t2,f2,t3,f3,t4,f4,t5,f5) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3, t4 f4, t5 f5);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY5(method,t1,f1,t2,f2,t3,f3,t4,f4,t5,f5) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3, t4 f4, t5 f5);
+#define BEGIN_PROTOCOL_ENTRY6(method,t1,f1,t2,f2,t3,f3,t4,f4,t5,f5,t6,f6) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3, t4 f4, t5 f5, t6 f6);
+#define BEGIN_PROTOCOL_ENTRY_HEAVY6(method,t1,f1,t2,f2,t3,f3,t4,f4,t5,f5,t6,f6) \
+       void sgen_client_ ## method (t1 f1, t2 f2, t3 f3, t4 f4, t5 f5, t6 f6);
+
+#define FLUSH()
+
+#define DEFAULT_PRINT()
+#define CUSTOM_PRINT(_)
+
+#define IS_ALWAYS_MATCH(_)
+#define MATCH_INDEX(_)
+#define IS_VTABLE_MATCH(_)
+
+#define END_PROTOCOL_ENTRY
+#define END_PROTOCOL_ENTRY_HEAVY
+
+#include "sgen-protocol-def.h"
+
+#undef TYPE_INT
+#undef TYPE_LONGLONG
+#undef TYPE_SIZE
+#undef TYPE_POINTER
+#undef TYPE_BOOL
index 0cb4633b36164ceffd5d7a1fc7d6a4e86b00e43e..56620fc37c5d5fd2525cc16cdfd08129adc45019 100644 (file)
@@ -40,14 +40,6 @@ par_copy_object_no_checks (char *destination, GCVTable *vt, void *obj, mword obj
        sgen_client_pre_copy_checks (destination, vt, obj, objsize);
        binary_protocol_copy (obj, destination, vt, objsize);
 
-#ifdef ENABLE_DTRACE
-       if (G_UNLIKELY (MONO_GC_OBJ_MOVED_ENABLED ())) {
-               int dest_gen = sgen_ptr_in_nursery (destination) ? GENERATION_NURSERY : GENERATION_OLD;
-               int src_gen = sgen_ptr_in_nursery (obj) ? GENERATION_NURSERY : GENERATION_OLD;
-               MONO_GC_OBJ_MOVED ((mword)destination, (mword)obj, dest_gen, src_gen, objsize, sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt));
-       }
-#endif
-
        /* FIXME: assumes object layout */
        memcpy (destination + sizeof (mword), (char*)obj + sizeof (mword), objsize - sizeof (mword));
 
index 6489ed0bf4f0773d7a602fd165ab692502afaf64..8958a0f834cb177c00f1f90729e8746affd800fd 100644 (file)
@@ -32,7 +32,6 @@
 #include "metadata/sgen-protocol.h"
 #include "metadata/sgen-pointer-queue.h"
 #include "metadata/sgen-client.h"
-#include "utils/dtrace.h"
 #include "utils/mono-counters.h"
 
 #define ptr_in_nursery sgen_ptr_in_nursery
@@ -862,20 +861,6 @@ sgen_process_dislink_stage_entries (void)
 void
 sgen_register_disappearing_link (GCObject *obj, void **link, gboolean track, gboolean in_gc)
 {
-
-#ifdef ENABLE_DTRACE
-       if (MONO_GC_WEAK_UPDATE_ENABLED ()) {
-               GCVTable *vt = obj ? (GCVTable*)SGEN_LOAD_VTABLE (obj) : NULL;
-               MONO_GC_WEAK_UPDATE ((mword)link,
-                               *link ? (mword)DISLINK_OBJECT (link) : (mword)0,
-                               (mword)obj,
-                               obj ? (mword)sgen_safe_object_get_size (obj) : (mword)0,
-                               obj ? sgen_client_vtable_get_namespace (vt) : NULL,
-                               obj ? sgen_client_vtable_get_name (vt) : NULL,
-                               track ? 1 : 0);
-       }
-#endif
-
        if (obj)
                *link = HIDE_POINTER (obj, track);
        else
index 22527269d4c1040d2cafba03e5bf9305435ddd97..e753e51c09fa4da9b1650b6fae983e7ca38d806e 100644 (file)
 #include "utils/mono-counters.h"
 #include "utils/mono-proclib.h"
 #include "utils/mono-memory-model.h"
-#include "utils/dtrace.h"
 
 #include <mono/utils/memcheck.h>
 
@@ -577,15 +576,6 @@ sgen_add_to_global_remset (gpointer ptr, gpointer obj)
 
        SGEN_LOG (8, "Adding global remset for %p", ptr);
        binary_protocol_global_remset (ptr, obj, (gpointer)SGEN_LOAD_VTABLE (obj));
-
-
-#ifdef ENABLE_DTRACE
-       if (G_UNLIKELY (MONO_GC_GLOBAL_REMSET_ADD_ENABLED ())) {
-               GCVTable *vt = (GCVTable*)LOAD_VTABLE (obj);
-               MONO_GC_GLOBAL_REMSET_ADD ((mword)ptr, (mword)obj, sgen_safe_object_get_size (obj),
-                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt));
-       }
-#endif
 }
 
 /*
@@ -767,16 +757,6 @@ pin_objects_from_nursery_pin_queue (gboolean do_scan_objects, ScanCopyContext ct
                                        (gpointer)LOAD_VTABLE (obj_to_pin),
                                        safe_object_get_size (obj_to_pin));
 
-#ifdef ENABLE_DTRACE
-                       if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
-                               int gen = sgen_ptr_in_nursery (obj_to_pin) ? GENERATION_NURSERY : GENERATION_OLD;
-                               GCVTable *vt = (GCVTable*)LOAD_VTABLE (obj_to_pin);
-                               MONO_GC_OBJ_PINNED ((mword)obj_to_pin,
-                                               sgen_safe_object_get_size (obj_to_pin),
-                                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), gen);
-                       }
-#endif
-
                        pin_object (obj_to_pin);
                        GRAY_OBJECT_ENQUEUE (queue, obj_to_pin, desc);
                        sgen_pin_stats_register_object (obj_to_pin, obj_to_pin_size);
@@ -825,15 +805,6 @@ sgen_pin_object (void *object, GrayQueue *queue)
        sgen_pin_stats_register_object (object, safe_object_get_size (object));
 
        GRAY_OBJECT_ENQUEUE (queue, object, sgen_obj_get_descriptor_safe (object));
-
-#ifdef ENABLE_DTRACE
-       if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
-               int gen = sgen_ptr_in_nursery (object) ? GENERATION_NURSERY : GENERATION_OLD;
-               GCVTable *vt = (GCVTable*)LOAD_VTABLE (object);
-               MONO_GC_OBJ_PINNED ((mword)object, sgen_safe_object_get_size (object),
-                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), gen);
-       }
-#endif
 }
 
 /* Sort the addresses in array in increasing order.
@@ -1620,7 +1591,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        TV_GETTIME (last_minor_collection_start_tv);
        atv = last_minor_collection_start_tv;
 
-       MONO_GC_BEGIN (GENERATION_NURSERY);
        binary_protocol_collection_begin (gc_stats.minor_gc_count, GENERATION_NURSERY);
 
        if (do_verify_nursery || do_dump_nursery_content)
@@ -1673,13 +1643,9 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        if (consistency_check_at_minor_collection)
                sgen_check_consistency ();
 
-       MONO_GC_CHECKPOINT_1 (GENERATION_NURSERY);
-
        sgen_process_fin_stage_entries ();
        sgen_process_dislink_stage_entries ();
 
-       MONO_GC_CHECKPOINT_2 (GENERATION_NURSERY);
-
        /* pin from pinned handles */
        sgen_init_pinning ();
        mono_profiler_gc_event (MONO_GC_EVENT_MARK_START, 0);
@@ -1698,8 +1664,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        SGEN_LOG (2, "Finding pinned pointers: %zd in %d usecs", sgen_get_pinned_count (), TV_ELAPSED (btv, atv));
        SGEN_LOG (4, "Start scan with %zd pinned objects", sgen_get_pinned_count ());
 
-       MONO_GC_CHECKPOINT_3 (GENERATION_NURSERY);
-
        /*
         * FIXME: When we finish a concurrent collection we do a nursery collection first,
         * as part of which we scan the card table.  Then, later, we scan the mod union
@@ -1714,8 +1678,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        time_minor_scan_remsets += TV_ELAPSED (atv, btv);
        SGEN_LOG (2, "Old generation scan: %d usecs", TV_ELAPSED (atv, btv));
 
-       MONO_GC_CHECKPOINT_4 (GENERATION_NURSERY);
-
        sgen_drain_gray_stack (-1, ctx);
 
        /* FIXME: Why do we do this at this specific, seemingly random, point? */
@@ -1724,24 +1686,17 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        TV_GETTIME (atv);
        time_minor_scan_pinned += TV_ELAPSED (btv, atv);
 
-       MONO_GC_CHECKPOINT_5 (GENERATION_NURSERY);
-
        enqueue_scan_from_roots_jobs (sgen_get_nursery_start (), nursery_next, object_ops);
 
        TV_GETTIME (btv);
        time_minor_scan_roots += TV_ELAPSED (atv, btv);
 
-       MONO_GC_CHECKPOINT_6 (GENERATION_NURSERY);
-       MONO_GC_CHECKPOINT_7 (GENERATION_NURSERY);
-       MONO_GC_CHECKPOINT_8 (GENERATION_NURSERY);
-
        finish_gray_stack (GENERATION_NURSERY, ctx);
+
        TV_GETTIME (atv);
        time_minor_finish_gray_stack += TV_ELAPSED (btv, atv);
        mono_profiler_gc_event (MONO_GC_EVENT_MARK_END, 0);
 
-       MONO_GC_CHECKPOINT_9 (GENERATION_NURSERY);
-
        if (objects_pinned) {
                sgen_optimize_pin_queue ();
                sgen_pinning_setup_section (nursery_section);
@@ -1799,7 +1754,6 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark)
        current_collection_generation = -1;
        objects_pinned = 0;
 
-       MONO_GC_END (GENERATION_NURSERY);
        binary_protocol_collection_end (gc_stats.minor_gc_count - 1, GENERATION_NURSERY, 0, 0);
 
        if (check_nursery_objects_pinned && !sgen_minor_collector.is_split)
@@ -1936,14 +1890,6 @@ major_copy_or_mark_from_roots (size_t *old_next_pin_slot, CopyOrMarkFromRootsMod
                if (sgen_find_optimized_pin_queue_area (bigobj->data, (char*)bigobj->data + sgen_los_object_size (bigobj), &dummy, &dummy)) {
                        binary_protocol_pin (bigobj->data, (gpointer)LOAD_VTABLE (bigobj->data), safe_object_get_size (((GCObject*)(bigobj->data))));
 
-#ifdef ENABLE_DTRACE
-                       if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
-                               GCVTable *vt = (GCVTable*)LOAD_VTABLE (bigobj->data);
-                               MONO_GC_OBJ_PINNED ((mword)bigobj->data, sgen_safe_object_get_size ((GCObject*)bigobj->data),
-                                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), GENERATION_OLD);
-                       }
-#endif
-
                        if (sgen_los_object_is_pinned (bigobj->data)) {
                                SGEN_ASSERT (0, mode == COPY_OR_MARK_FROM_ROOTS_FINISH_CONCURRENT, "LOS objects can only be pinned here after concurrent marking.");
                                continue;
@@ -2079,7 +2025,6 @@ major_start_collection (gboolean concurrent, size_t *old_next_pin_slot)
 {
        SgenObjectOperations *object_ops;
 
-       MONO_GC_BEGIN (GENERATION_OLD);
        binary_protocol_collection_begin (gc_stats.major_gc_count, GENERATION_OLD);
 
        current_collection_generation = GENERATION_OLD;
@@ -2217,7 +2162,7 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
        TV_GETTIME (btv);
        time_major_fragment_creation += TV_ELAPSED (atv, btv);
 
-       MONO_GC_SWEEP_BEGIN (GENERATION_OLD, !major_collector.sweeps_lazily);
+       binary_protocol_sweep_begin (GENERATION_OLD, !major_collector.sweeps_lazily);
 
        TV_GETTIME (atv);
        time_major_free_bigobjs += TV_ELAPSED (btv, atv);
@@ -2229,7 +2174,7 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
 
        major_collector.sweep ();
 
-       MONO_GC_SWEEP_END (GENERATION_OLD, !major_collector.sweeps_lazily);
+       binary_protocol_sweep_end (GENERATION_OLD, !major_collector.sweeps_lazily);
 
        TV_GETTIME (atv);
        time_major_sweep += TV_ELAPSED (btv, atv);
@@ -2261,7 +2206,6 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean
 
        //consistency_check ();
 
-       MONO_GC_END (GENERATION_OLD);
        binary_protocol_collection_end (gc_stats.major_gc_count - 1, GENERATION_OLD, counts.num_scanned_objects, counts.num_unique_scanned_objects);
 }
 
@@ -2312,7 +2256,6 @@ major_start_concurrent_collection (const char *reason)
        num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
        g_assert (num_objects_marked == 0);
 
-       MONO_GC_CONCURRENT_START_BEGIN (GENERATION_OLD);
        binary_protocol_concurrent_start ();
 
        // FIXME: store reason and pass it when finishing
@@ -2321,7 +2264,6 @@ major_start_concurrent_collection (const char *reason)
        gray_queue_redirect (&gray_queue);
 
        num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
-       MONO_GC_CONCURRENT_START_END (GENERATION_OLD, num_objects_marked);
 
        TV_GETTIME (time_end);
        gc_stats.major_gc_time += TV_ELAPSED (time_start, time_end);
@@ -2347,14 +2289,11 @@ major_update_concurrent_collection (void)
 
        TV_GETTIME (total_start);
 
-       MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, major_collector.get_and_reset_num_major_objects_marked ());
        binary_protocol_concurrent_update ();
 
        major_collector.update_cardtable_mod_union ();
        sgen_los_update_cardtable_mod_union ();
 
-       MONO_GC_CONCURRENT_UPDATE_END (GENERATION_OLD, major_collector.get_and_reset_num_major_objects_marked ());
-
        TV_GETTIME (total_end);
        gc_stats.major_gc_time += TV_ELAPSED (total_start, total_end);
 }
@@ -2370,7 +2309,6 @@ major_finish_concurrent_collection (gboolean forced)
 
        TV_GETTIME (total_start);
 
-       MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, major_collector.get_and_reset_num_major_objects_marked ());
        binary_protocol_concurrent_finish ();
 
        /*
@@ -2401,8 +2339,6 @@ major_finish_concurrent_collection (gboolean forced)
        unpin_objects_from_queue (&unpin_queue);
        sgen_gray_object_queue_deinit (&unpin_queue);
 
-       MONO_GC_CONCURRENT_FINISH_END (GENERATION_OLD, major_collector.get_and_reset_num_major_objects_marked ());
-
        TV_GETTIME (total_end);
        gc_stats.major_gc_time += TV_ELAPSED (total_start, total_end) - TV_ELAPSED (last_minor_collection_start_tv, last_minor_collection_end_tv);
 
@@ -2467,9 +2403,7 @@ sgen_perform_collection (size_t requested_size, int generation_to_collect, const
        int oldest_generation_collected = generation_to_collect;
        const char *overflow_reason = NULL;
 
-       MONO_GC_REQUESTED (generation_to_collect, requested_size, wait_to_finish ? 1 : 0);
-       if (wait_to_finish)
-               binary_protocol_collection_force (generation_to_collect);
+       binary_protocol_collection_requested (generation_to_collect, requested_size, wait_to_finish ? 1 : 0);
 
        SGEN_ASSERT (0, generation_to_collect == GENERATION_NURSERY || generation_to_collect == GENERATION_OLD, "What generation is this?");
 
@@ -2674,15 +2608,6 @@ sgen_queue_finalization_entry (GCObject *obj)
        sgen_pointer_queue_add (critical ? &critical_fin_queue : &fin_ready_queue, obj);
 
        sgen_client_object_queued_for_finalization (obj);
-
-#ifdef ENABLE_DTRACE
-       if (G_UNLIKELY (MONO_GC_FINALIZE_ENQUEUE_ENABLED ())) {
-               int gen = sgen_ptr_in_nursery (obj) ? GENERATION_NURSERY : GENERATION_OLD;
-               GCVTable *vt = (GCVTable*)LOAD_VTABLE (obj);
-               MONO_GC_FINALIZE_ENQUEUE ((mword)obj, sgen_safe_object_get_size (obj),
-                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), gen, critical);
-       }
-#endif
 }
 
 gboolean
@@ -3851,7 +3776,6 @@ sgen_gc_unlock (void)
        gboolean try_free = sgen_try_free_some_memory;
        sgen_try_free_some_memory = FALSE;
        mono_mutex_unlock (&gc_mutex);
-       MONO_GC_UNLOCKED ();
        if (try_free)
                mono_thread_hazardous_try_free_some ();
 }
index 475ed08105255bca84ef487d8d4731a1891824aa..dccfaf1607f17d949329cd6c35f71968ed6cceaa 100644 (file)
@@ -37,7 +37,6 @@ typedef struct _SgenThreadInfo SgenThreadInfo;
 #endif
 #include <mono/utils/mono-compiler.h>
 #include <mono/utils/mono-threads.h>
-#include <mono/utils/dtrace.h>
 /* FIXME: remove logging and don't include this */
 #include <mono/utils/mono-logger-internal.h>
 #include <mono/utils/atomic.h>
@@ -157,7 +156,6 @@ struct _GCMemSection {
 #define LOCK_GC do {                                           \
                MONO_TRY_BLOCKING       \
                mono_mutex_lock (&gc_mutex);                    \
-               MONO_GC_LOCKED ();                              \
                MONO_FINISH_TRY_BLOCKING        \
        } while (0)
 #define UNLOCK_GC do { sgen_gc_unlock (); } while (0)
index 9f5573a6b77fc4f583d6e25fa5b6189dd3d7b6b6..a71a6829687ac18e696dc8c23ec6b8989d409317 100644 (file)
@@ -180,8 +180,6 @@ sgen_alloc_internal_dynamic (size_t size, int type, gboolean assert_on_failure)
                        sgen_assert_memory_alloc (NULL, size, description_for_type (type));
                memset (p, 0, size);
        }
-
-       MONO_GC_INTERNAL_ALLOC ((mword)p, size, type);
        return p;
 }
 
@@ -195,8 +193,6 @@ sgen_free_internal_dynamic (void *addr, size_t size, int type)
                sgen_free_os_memory (addr, size, SGEN_ALLOC_INTERNAL);
        else
                mono_lock_free_free (addr, block_size (size));
-
-       MONO_GC_INTERNAL_DEALLOC ((mword)addr, size, type);
 }
 
 void*
@@ -217,8 +213,6 @@ sgen_alloc_internal (int type)
        p = mono_lock_free_alloc (&allocators [index]);
        memset (p, 0, size);
 
-       MONO_GC_INTERNAL_ALLOC ((mword)p, size, type);
-
        return p;
 }
 
@@ -234,11 +228,6 @@ sgen_free_internal (void *addr, int type)
        g_assert (index >= 0 && index < NUM_ALLOCATORS);
 
        mono_lock_free_free (addr, allocator_block_sizes [index]);
-
-       if (MONO_GC_INTERNAL_DEALLOC_ENABLED ()) {
-               int size G_GNUC_UNUSED = allocator_sizes [index];
-               MONO_GC_INTERNAL_DEALLOC ((mword)addr, size, type);
-       }
 }
 
 void
index c4703dff63cd3e19a2c704382dd6bd0cc28e2a93..7d815a36b2885b9e82538f1fd809f836841031d3 100644 (file)
@@ -1136,13 +1136,7 @@ major_copy_or_mark_object_concurrent (void **ptr, void *obj, SgenGrayQueue *queu
                        if (sgen_los_object_is_pinned (obj))
                                return;
 
-#ifdef ENABLE_DTRACE
-                       if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
-                               GCVTable *vt = (GCVTable*)SGEN_LOAD_VTABLE (obj);
-                               MONO_GC_OBJ_PINNED ((mword)obj, sgen_safe_object_get_size (obj),
-                                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), GENERATION_OLD);
-                       }
-#endif
+                       binary_protocol_mark (obj, SGEN_LOAD_VTABLE (obj), sgen_safe_object_get_size (obj));
 
                        sgen_los_pin_object (obj);
                        if (SGEN_OBJECT_HAS_REFERENCES (obj))
@@ -1297,7 +1291,6 @@ sweep_block_for_size (MSBlockInfo *block, int count, int obj_size)
                                 * will also benefit?
                                 */
                                binary_protocol_empty (obj, obj_size);
-                               MONO_GC_MAJOR_SWEPT ((mword)obj, obj_size);
                                memset (obj, 0, obj_size);
                        }
                        *(void**)obj = block->free_list;
@@ -1818,7 +1811,7 @@ major_start_major_collection (void)
        }
 
        if (lazy_sweep)
-               MONO_GC_SWEEP_BEGIN (GENERATION_OLD, TRUE);
+               binary_protocol_sweep_begin (GENERATION_OLD, TRUE);
 
        /* Sweep all unswept blocks and set them to MARKING */
        FOREACH_BLOCK_NO_LOCK (block) {
@@ -1829,7 +1822,7 @@ major_start_major_collection (void)
        } END_FOREACH_BLOCK_NO_LOCK;
 
        if (lazy_sweep)
-               MONO_GC_SWEEP_END (GENERATION_OLD, TRUE);
+               binary_protocol_sweep_end (GENERATION_OLD, TRUE);
 
        set_sweep_state (SWEEP_STATE_NEED_SWEEPING, SWEEP_STATE_SWEPT);
 }
index 70cc6f0788329a1d2c27525d9bd5e2ba5162bec4..d9660dbf696074be17c8ff23fcefb77360b64bc0 100644 (file)
@@ -35,7 +35,6 @@
 #include "utils/mono-counters.h"
 #include "utils/mono-mmap.h"
 #include "utils/mono-logger-internal.h"
-#include "utils/dtrace.h"
 
 #define MIN_MINOR_COLLECTION_ALLOWANCE ((mword)(DEFAULT_NURSERY_SIZE * default_allowance_nursery_size_ratio))
 
@@ -266,8 +265,6 @@ sgen_alloc_os_memory (size_t size, SgenAllocFlags flags, const char *assert_desc
        sgen_assert_memory_alloc (ptr, size, assert_description);
        if (ptr) {
                SGEN_ATOMIC_ADD_P (total_alloc, size);
-               if (flags & SGEN_ALLOC_HEAP)
-                       MONO_GC_HEAP_ALLOC ((mword)ptr, size);
                total_alloc_max = MAX (total_alloc_max, total_alloc);
        }
        return ptr;
@@ -285,8 +282,6 @@ sgen_alloc_os_memory_aligned (size_t size, mword alignment, SgenAllocFlags flags
        sgen_assert_memory_alloc (ptr, size, assert_description);
        if (ptr) {
                SGEN_ATOMIC_ADD_P (total_alloc, size);
-               if (flags & SGEN_ALLOC_HEAP)
-                       MONO_GC_HEAP_ALLOC ((mword)ptr, size);
                total_alloc_max = MAX (total_alloc_max, total_alloc);
        }
        return ptr;
@@ -302,8 +297,6 @@ sgen_free_os_memory (void *addr, size_t size, SgenAllocFlags flags)
 
        mono_vfree (addr, size);
        SGEN_ATOMIC_ADD_P (total_alloc, -(gssize)size);
-       if (flags & SGEN_ALLOC_HEAP)
-               MONO_GC_HEAP_FREE ((mword)addr, size);
        total_alloc_max = MAX (total_alloc_max, total_alloc);
 }
 
index 6edb9027eff2a1d6e875cf8195dab0c276376e3b..d89691e2f21d657cbaa880c7d3703b6fa9f8b4c0 100644 (file)
@@ -33,6 +33,7 @@
 #include "metadata/mono-gc.h"
 #include "metadata/runtime.h"
 #include "utils/mono-memory-model.h"
+#include "utils/dtrace.h"
 
 /* If set, check that there are no references to the domain left at domain unload */
 gboolean sgen_mono_xdomain_checks = FALSE;
@@ -430,6 +431,16 @@ sgen_client_object_queued_for_finalization (GCObject *obj)
 {
        if (fin_callbacks.object_queued_for_finalization && is_finalization_aware (obj))
                fin_callbacks.object_queued_for_finalization (obj);
+
+#ifdef ENABLE_DTRACE
+       if (G_UNLIKELY (MONO_GC_FINALIZE_ENQUEUE_ENABLED ())) {
+               int gen = sgen_ptr_in_nursery (obj) ? GENERATION_NURSERY : GENERATION_OLD;
+               GCVTable *vt = (GCVTable*)SGEN_LOAD_VTABLE (obj);
+               MONO_GC_FINALIZE_ENQUEUE ((mword)obj, sgen_safe_object_get_size (obj),
+                               sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt), gen,
+                               sgen_client_object_has_critical_finalizer (obj));
+       }
+#endif
 }
 
 void
@@ -2065,6 +2076,193 @@ sgen_client_vtable_get_name (GCVTable *gc_vtable)
        return vt->klass->name;
 }
 
+/*
+ * Protocol / DTrace
+ */
+
+#ifdef ENABLE_DTRACE
+void
+sgen_client_binary_protocol_collection_requested (int generation, size_t requested_size, gboolean force)
+{
+       MONO_GC_REQUESTED (generation, requested_size, force);
+}
+
+void
+sgen_client_binary_protocol_collection_begin (int minor_gc_count, int generation)
+{
+       MONO_GC_BEGIN (generation);
+}
+
+void
+sgen_client_binary_protocol_collection_end (int minor_gc_count, int generation, long long num_objects_scanned, long long num_unique_objects_scanned)
+{
+       MONO_GC_END (generation);
+}
+
+void
+sgen_client_binary_protocol_concurrent_start (void)
+{
+       MONO_GC_CONCURRENT_START_BEGIN (GENERATION_OLD);
+}
+
+void
+sgen_client_binary_protocol_concurrent_update (void)
+{
+       MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, sgen_get_major_collector ()->get_and_reset_num_major_objects_marked ());
+}
+
+void
+sgen_client_binary_protocol_concurrent_finish (void)
+{
+       MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, sgen_get_major_collector ()->get_and_reset_num_major_objects_marked ());
+}
+
+void
+sgen_client_binary_protocol_sweep_begin (int generation, int full_sweep)
+{
+       MONO_GC_SWEEP_BEGIN (generation, full_sweep);
+}
+
+void
+sgen_client_binary_protocol_sweep_end (int generation, int full_sweep)
+{
+       MONO_GC_SWEEP_END (generation, full_sweep);
+}
+
+void
+sgen_client_binary_protocol_world_stopping (long long timestamp)
+{
+       MONO_GC_WORLD_STOP_BEGIN ();
+}
+
+void
+sgen_client_binary_protocol_world_stopped (long long timestamp, long long total_major_cards, long long marked_major_cards, long long total_los_cards, long long marked_los_cards)
+{
+       MONO_GC_WORLD_STOP_END ();
+}
+
+void
+sgen_client_binary_protocol_world_restarting (int generation, long long timestamp, long long total_major_cards, long long marked_major_cards, long long total_los_cards, long long marked_los_cards)
+{
+       MONO_GC_WORLD_RESTART_BEGIN (generation);
+}
+
+void
+sgen_client_binary_protocol_world_restarted (int generation, long long timestamp)
+{
+       MONO_GC_WORLD_RESTART_END (generation);
+}
+
+static void
+protocol_alloc (gpointer obj, gpointer vtable, size_t size, gboolean pinned)
+{
+       const char *namespace = sgen_client_vtable_get_namespace (vtable);
+       const char *name = sgen_client_vtable_get_name (vtable);
+
+       if (sgen_ptr_in_nursery (obj)) {
+               if (G_UNLIKELY (MONO_GC_NURSERY_OBJ_ALLOC_ENABLED ()))
+                       MONO_GC_NURSERY_OBJ_ALLOC ((mword)obj, size, namespace, name);
+       } else {
+               if (size > SGEN_MAX_SMALL_OBJ_SIZE) {
+                       if (G_UNLIKELY (MONO_GC_MAJOR_OBJ_ALLOC_LARGE_ENABLED ()))
+                               MONO_GC_MAJOR_OBJ_ALLOC_LARGE ((mword)obj, size, namespace, name);
+               } else if (pinned) {
+                       MONO_GC_MAJOR_OBJ_ALLOC_PINNED ((mword)obj, size, namespace, name);
+               }
+       }
+}
+
+void
+sgen_client_binary_protocol_alloc (gpointer obj, gpointer vtable, size_t size)
+{
+       protocol_alloc (obj, vtable, size, FALSE);
+}
+
+void
+sgen_client_binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, size_t size)
+{
+       protocol_alloc (obj, vtable, size, TRUE);
+}
+
+void
+sgen_client_binary_protocol_alloc_degraded (gpointer obj, gpointer vtable, size_t size)
+{
+       MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED ((mword)obj, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
+}
+
+void
+sgen_client_binary_protocol_pin (gpointer obj, gpointer vtable, size_t size)
+{
+#ifdef ENABLE_DTRACE
+       if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) {
+               int gen = sgen_ptr_in_nursery (obj) ? GENERATION_NURSERY : GENERATION_OLD;
+               MONO_GC_OBJ_PINNED ((mword)obj,
+                               sgen_safe_object_get_size (obj),
+                               sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable), gen);
+       }
+#endif
+}
+
+void
+sgen_client_binary_protocol_cement (gpointer ptr, gpointer vtable, size_t size)
+{
+#ifdef ENABLE_DTRACE
+       if (G_UNLIKELY (MONO_GC_OBJ_CEMENTED_ENABLED())) {
+               MONO_GC_OBJ_CEMENTED ((mword)ptr, sgen_safe_object_get_size ((GCObject*)ptr),
+                               sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
+       }
+#endif
+}
+
+void
+sgen_client_binary_protocol_copy (gpointer from, gpointer to, gpointer vtable, size_t size)
+{
+#ifdef ENABLE_DTRACE
+       if (G_UNLIKELY (MONO_GC_OBJ_MOVED_ENABLED ())) {
+               int dest_gen = sgen_ptr_in_nursery (to) ? GENERATION_NURSERY : GENERATION_OLD;
+               int src_gen = sgen_ptr_in_nursery (from) ? GENERATION_NURSERY : GENERATION_OLD;
+               MONO_GC_OBJ_MOVED ((mword)to, (mword)from, dest_gen, src_gen, size, sgen_client_vtable_get_namespace (vtable), sgen_client_vtable_get_name (vtable));
+       }
+#endif
+}
+
+void
+sgen_client_binary_protocol_global_remset (gpointer ptr, gpointer value, gpointer value_vtable)
+{
+#ifdef ENABLE_DTRACE
+       if (G_UNLIKELY (MONO_GC_GLOBAL_REMSET_ADD_ENABLED ())) {
+               MONO_GC_GLOBAL_REMSET_ADD ((mword)ptr, (mword)value, sgen_safe_object_get_size (value),
+                               sgen_client_vtable_get_namespace (value_vtable), sgen_client_vtable_get_name (value_vtable));
+       }
+#endif
+}
+
+void
+sgen_client_binary_protocol_dislink_update (gpointer link, gpointer obj, gboolean track, gboolean staged)
+{
+#ifdef ENABLE_DTRACE
+       if (MONO_GC_WEAK_UPDATE_ENABLED ()) {
+               GCVTable *vt = obj ? (GCVTable*)SGEN_LOAD_VTABLE (obj) : NULL;
+               MONO_GC_WEAK_UPDATE ((mword)link,
+                               (mword)obj,
+                               obj ? (mword)sgen_safe_object_get_size (obj) : (mword)0,
+                               obj ? sgen_client_vtable_get_namespace (vt) : NULL,
+                               obj ? sgen_client_vtable_get_name (vt) : NULL,
+                               track ? 1 : 0);
+       }
+#endif
+}
+
+void
+sgen_client_binary_protocol_empty (gpointer start, size_t size)
+{
+       if (sgen_ptr_in_nursery (start))
+               MONO_GC_NURSERY_SWEPT ((mword)start, size);
+       else
+               MONO_GC_MAJOR_SWEPT ((mword)start, size);
+}
+#endif
+
 /*
  * Initialization
  */
index 106a42f9b47d8ce86626ba29372e78bb897f83e8..408703ccfaf4df7d4e6ba40b76c6682dc6fa051b 100644 (file)
@@ -679,7 +679,6 @@ add_nursery_frag (SgenFragmentAllocator *allocator, size_t frag_size, char* frag
 {
        SGEN_LOG (4, "Found empty fragment: %p-%p, size: %zd", frag_start, frag_end, frag_size);
        binary_protocol_empty (frag_start, frag_size);
-       MONO_GC_NURSERY_SWEPT ((mword)frag_start, frag_end - frag_start);
        /* Not worth dealing with smaller fragments: need to tune */
        if (frag_size >= SGEN_MAX_NURSERY_WASTE) {
                /* memsetting just the first chunk start is bound to provide better cache locality */
index 246daa6d3cf3f4473ae45e43961a87bb52cc7396..67a22eabc1fae1035836e715e5bad02c6bbe97af 100644 (file)
@@ -249,11 +249,6 @@ sgen_cement_lookup_or_register (char *obj)
                SGEN_ASSERT (9, SGEN_OBJECT_IS_PINNED (obj), "Can only cement pinned objects");
                SGEN_CEMENT_OBJECT (obj);
 
-               if (G_UNLIKELY (MONO_GC_OBJ_CEMENTED_ENABLED())) {
-                       GCVTable *vt G_GNUC_UNUSED = (GCVTable*)SGEN_LOAD_VTABLE (obj);
-                       MONO_GC_OBJ_CEMENTED ((mword)obj, sgen_safe_object_get_size ((GCObject*)obj),
-                                       sgen_client_vtable_get_namespace (vt), sgen_client_vtable_get_name (vt));
-               }
                binary_protocol_cement (obj, (gpointer)SGEN_LOAD_VTABLE (obj),
                                (int)sgen_safe_object_get_size ((GCObject*)obj));
        }
index f9196ffe5b99a11a9899f6be2eb335f24387ec30..b3d00837a258c5fb159c9a82812a013ff0c2dac0 100644 (file)
@@ -1,4 +1,4 @@
-BEGIN_PROTOCOL_ENTRY1 (binary_protocol_collection_force, TYPE_INT, generation)
+BEGIN_PROTOCOL_ENTRY3 (binary_protocol_collection_requested, TYPE_INT, generation, TYPE_SIZE, requested_size, TYPE_BOOL, force)
 FLUSH ()
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
@@ -43,6 +43,20 @@ MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY
 
+BEGIN_PROTOCOL_ENTRY2 (binary_protocol_sweep_begin, TYPE_INT, generation, TYPE_BOOL, full_sweep)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (TRUE)
+MATCH_INDEX (BINARY_PROTOCOL_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY
+
+BEGIN_PROTOCOL_ENTRY2 (binary_protocol_sweep_end, TYPE_INT, generation, TYPE_BOOL, full_sweep)
+DEFAULT_PRINT ()
+IS_ALWAYS_MATCH (TRUE)
+MATCH_INDEX (BINARY_PROTOCOL_MATCH)
+IS_VTABLE_MATCH (FALSE)
+END_PROTOCOL_ENTRY
+
 BEGIN_PROTOCOL_ENTRY1 (binary_protocol_world_stopping, TYPE_LONGLONG, timestamp)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (TRUE)
@@ -92,14 +106,14 @@ MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTO
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_copy, TYPE_POINTER, from, TYPE_POINTER, to, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_copy, TYPE_POINTER, from, TYPE_POINTER, to, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->from, entry->size) ? 0 : matches_interval (ptr, entry->to, entry->size) ? 1 : BINARY_PROTOCOL_NO_MATCH)
@@ -120,28 +134,28 @@ MATCH_INDEX (ptr == entry->addr ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_pin, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_pin, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_mark, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_mark, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_scan_begin, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_scan_begin, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_scan_vtype_begin, TYPE_POINTER, obj, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_scan_vtype_begin, TYPE_POINTER, obj, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
@@ -169,21 +183,21 @@ MATCH_INDEX (ptr == entry->ptr ? 0 : ptr == entry->value ? 1 : BINARY_PROTOCOL_N
 IS_VTABLE_MATCH (ptr == entry->value_vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY5 (binary_protocol_ptr_update, TYPE_POINTER, ptr, TYPE_POINTER, old_value, TYPE_POINTER, new_value, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY5 (binary_protocol_ptr_update, TYPE_POINTER, ptr, TYPE_POINTER, old_value, TYPE_POINTER, new_value, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (ptr == entry->ptr ? 0 : matches_interval (ptr, entry->old_value, entry->size) ? 1 : matches_interval (ptr, entry->new_value, entry->size) ? 2 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_cleanup, TYPE_POINTER, ptr, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_cleanup, TYPE_POINTER, ptr, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->ptr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_empty, TYPE_POINTER, start, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_empty, TYPE_POINTER, start, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->start, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
@@ -218,35 +232,35 @@ MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY
 
-BEGIN_PROTOCOL_ENTRY6 (binary_protocol_missing_remset, TYPE_POINTER, obj, TYPE_POINTER, obj_vtable, TYPE_INT, offset, TYPE_POINTER, value, TYPE_POINTER, value_vtable, TYPE_INT, value_pinned)
+BEGIN_PROTOCOL_ENTRY6 (binary_protocol_missing_remset, TYPE_POINTER, obj, TYPE_POINTER, obj_vtable, TYPE_INT, offset, TYPE_POINTER, value, TYPE_POINTER, value_vtable, TYPE_BOOL, value_pinned)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->value ? 3 : ptr == (char*)entry->obj + entry->offset ? BINARY_PROTOCOL_MATCH : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->obj_vtable || ptr == entry->value_vtable)
 END_PROTOCOL_ENTRY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc_pinned, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc_pinned, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc_degraded, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_alloc_degraded, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (ptr == entry->vtable)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_card_scan, TYPE_POINTER, start, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_card_scan, TYPE_POINTER, start, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->start, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY3 (binary_protocol_cement, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_INT, size)
+BEGIN_PROTOCOL_ENTRY3 (binary_protocol_cement, TYPE_POINTER, obj, TYPE_POINTER, vtable, TYPE_SIZE, size)
 DEFAULT_PRINT ()
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (matches_interval (ptr, entry->obj, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH)
@@ -260,14 +274,14 @@ MATCH_INDEX (BINARY_PROTOCOL_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_dislink_update, TYPE_POINTER, link, TYPE_POINTER, obj, TYPE_INT, track, TYPE_INT, staged)
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_dislink_update, TYPE_POINTER, link, TYPE_POINTER, obj, TYPE_BOOL, track, TYPE_BOOL, staged)
 CUSTOM_PRINT(entry->obj ? printf ("link %p obj %p staged %d track %d", entry->link, entry->obj, entry->staged, entry->track) : printf ("link %p obj %p staged %d", entry->link, entry->obj, entry->staged))
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (ptr == entry->link ? 0 : ptr == entry->obj ? 1 : BINARY_PROTOCOL_NO_MATCH)
 IS_VTABLE_MATCH (FALSE)
 END_PROTOCOL_ENTRY_HEAVY
 
-BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_dislink_update_staged, TYPE_POINTER, link, TYPE_POINTER, obj, TYPE_INT, track, TYPE_INT, index)
+BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_dislink_update_staged, TYPE_POINTER, link, TYPE_POINTER, obj, TYPE_BOOL, track, TYPE_INT, index)
 CUSTOM_PRINT(entry->obj ? printf ("link %p obj %p index %d track %d", entry->link, entry->obj, entry->index, entry->track) : printf ("link %p obj %p index %d", entry->link, entry->obj, entry->index))
 IS_ALWAYS_MATCH (FALSE)
 MATCH_INDEX (ptr == entry->link ? 0 : ptr == entry->obj ? 1 : BINARY_PROTOCOL_NO_MATCH)
index bbabb8ee36d78d9a48b9b897173eec52003ace2e..688e757d9e10938c89e2a975435c9dc33b75fc3d 100644 (file)
@@ -28,6 +28,7 @@
 #include "sgen-protocol.h"
 #include "sgen-memory-governor.h"
 #include "sgen-thread-pool.h"
+#include "sgen-client.h"
 #include "utils/mono-mmap.h"
 #include "utils/mono-threads.h"
 
@@ -326,48 +327,56 @@ protocol_entry (unsigned char type, gpointer data, int size)
 #define TYPE_LONGLONG long long
 #define TYPE_SIZE size_t
 #define TYPE_POINTER gpointer
+#define TYPE_BOOL gboolean
 
 #define BEGIN_PROTOCOL_ENTRY0(method) \
        void method (void) { \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = NULL; \
-               int __size = 0;
+               int __size = 0; \
+               CLIENT_PROTOCOL_NAME (method) ();
 #define BEGIN_PROTOCOL_ENTRY1(method,t1,f1) \
        void method (t1 f1) { \
                PROTOCOL_STRUCT(method) __entry = { f1 }; \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = &__entry; \
-               int __size = sizeof (PROTOCOL_STRUCT(method));
+               int __size = sizeof (PROTOCOL_STRUCT(method)); \
+               CLIENT_PROTOCOL_NAME (method) (f1);
 #define BEGIN_PROTOCOL_ENTRY2(method,t1,f1,t2,f2) \
        void method (t1 f1, t2 f2) { \
                PROTOCOL_STRUCT(method) __entry = { f1, f2 }; \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = &__entry; \
-               int __size = sizeof (PROTOCOL_STRUCT(method));
+               int __size = sizeof (PROTOCOL_STRUCT(method)); \
+               CLIENT_PROTOCOL_NAME (method) (f1, f2);
 #define BEGIN_PROTOCOL_ENTRY3(method,t1,f1,t2,f2,t3,f3) \
        void method (t1 f1, t2 f2, t3 f3) { \
                PROTOCOL_STRUCT(method) __entry = { f1, f2, f3 }; \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = &__entry; \
-               int __size = sizeof (PROTOCOL_STRUCT(method));
+               int __size = sizeof (PROTOCOL_STRUCT(method)); \
+               CLIENT_PROTOCOL_NAME (method) (f1, f2, f3);
 #define BEGIN_PROTOCOL_ENTRY4(method,t1,f1,t2,f2,t3,f3,t4,f4) \
        void method (t1 f1, t2 f2, t3 f3, t4 f4) { \
                PROTOCOL_STRUCT(method) __entry = { f1, f2, f3, f4 }; \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = &__entry; \
-               int __size = sizeof (PROTOCOL_STRUCT(method));
+               int __size = sizeof (PROTOCOL_STRUCT(method)); \
+               CLIENT_PROTOCOL_NAME (method) (f1, f2, f3, f4);
 #define BEGIN_PROTOCOL_ENTRY5(method,t1,f1,t2,f2,t3,f3,t4,f4,t5,f5) \
        void method (t1 f1, t2 f2, t3 f3, t4 f4, t5 f5) { \
                PROTOCOL_STRUCT(method) __entry = { f1, f2, f3, f4, f5 }; \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = &__entry; \
-               int __size = sizeof (PROTOCOL_STRUCT(method));
+               int __size = sizeof (PROTOCOL_STRUCT(method)); \
+               CLIENT_PROTOCOL_NAME (method) (f1, f2, f3, f4, f5);
 #define BEGIN_PROTOCOL_ENTRY6(method,t1,f1,t2,f2,t3,f3,t4,f4,t5,f5,t6,f6) \
        void method (t1 f1, t2 f2, t3 f3, t4 f4, t5 f5, t6 f6) { \
                PROTOCOL_STRUCT(method) __entry = { f1, f2, f3, f4, f5, f6 }; \
                int __type = PROTOCOL_ID(method); \
                gpointer __data = &__entry; \
-               int __size = sizeof (PROTOCOL_STRUCT(method));
+               int __size = sizeof (PROTOCOL_STRUCT(method)); \
+               CLIENT_PROTOCOL_NAME (method) (f1, f2, f3, f4, f5, f6);
 
 #define FLUSH() \
                binary_protocol_flush_buffers (FALSE);
@@ -419,5 +428,6 @@ protocol_entry (unsigned char type, gpointer data, int size)
 #undef TYPE_LONGLONG
 #undef TYPE_SIZE
 #undef TYPE_POINTER
+#undef TYPE_BOOL
 
 #endif /* HAVE_SGEN_GC */
index 31e10389f1fe1e37178bbaf63394efc9294b651c..2b7176e5f2d062118f01c0c1cc51b24e616d0bbc 100644 (file)
 
 #define PROTOCOL_ID(method) method ## _id
 #define PROTOCOL_STRUCT(method) method ## _struct
+#define CLIENT_PROTOCOL_NAME(method) sgen_client_ ## method
 
 #define TYPE_INT int
 #define TYPE_LONGLONG long long
 #define TYPE_SIZE size_t
 #define TYPE_POINTER gpointer
+#define TYPE_BOOL gboolean
 
 enum {
 #define BEGIN_PROTOCOL_ENTRY0(method) PROTOCOL_ID(method),
@@ -214,5 +216,6 @@ void binary_protocol_flush_buffers (gboolean force);
 #undef TYPE_LONGLONG
 #undef TYPE_SIZE
 #undef TYPE_POINTER
+#undef TYPE_BOOL
 
 #endif
index c16d380d5a7e6a592808e718e4942c60c4f3437f..fd8c08581b7ee4bcc22ccb4d59502c5f152b73eb 100644 (file)
@@ -33,7 +33,6 @@
 #include "metadata/sgen-thread-pool.h"
 #include "metadata/profiler-private.h"
 #include "utils/mono-time.h"
-#include "utils/dtrace.h"
 #include "utils/mono-counters.h"
 #include "utils/mono-threads.h"
 
@@ -218,11 +217,11 @@ sgen_stop_world (int generation)
 {
        TV_DECLARE (end_handshake);
        int count, dead;
+       long long major_total = -1, major_marked = -1, los_total = -1, los_marked = -1;
 
        SGEN_ASSERT (0, !world_is_stopped, "Why are we stopping a stopped world?");
 
        mono_profiler_gc_event (MONO_GC_EVENT_PRE_STOP_WORLD, generation);
-       MONO_GC_WORLD_STOP_BEGIN ();
        binary_protocol_world_stopping (sgen_timestamp ());
        acquire_gc_locks ();
 
@@ -249,13 +248,9 @@ 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 ();
-       if (binary_protocol_is_enabled ()) {
-               long long major_total = -1, major_marked = -1, los_total = -1, los_marked = -1;
-               if (binary_protocol_is_heavy_enabled ())
-                       count_cards (&major_total, &major_marked, &los_total, &los_marked);
-               binary_protocol_world_stopped (sgen_timestamp (), major_total, major_marked, los_total, los_marked);
-       }
+       if (binary_protocol_is_heavy_enabled ())
+               count_cards (&major_total, &major_marked, &los_total, &los_marked);
+       binary_protocol_world_stopped (sgen_timestamp (), major_total, major_marked, los_total, los_marked);
 
        TV_GETTIME (end_handshake);
        time_stop_world += TV_ELAPSED (stop_world_time, end_handshake);
@@ -292,7 +287,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 (generation);
+
        FOREACH_THREAD (info) {
                info->stack_start = NULL;
 #ifdef USE_MONO_CTX
@@ -319,7 +314,6 @@ sgen_restart_world (int generation, GGTimingInfo *timing)
 
        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 (generation);
        binary_protocol_world_restarted (generation, sgen_timestamp ());
 
        /*
index 4e242ba10e07027afb2be3993c2fcb3b3ef229fd..c5c153bbca925462dd90b5958272916f6148af9c 100644 (file)
 #define MONO_GC_REQUESTED_ENABLED()    (0)
 
 
-#define MONO_GC_CHECKPOINT_1(generation)
-#define MONO_GC_CHECKPOINT_1_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_2(generation)
-#define MONO_GC_CHECKPOINT_2_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_3(generation)
-#define MONO_GC_CHECKPOINT_3_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_4(generation)
-#define MONO_GC_CHECKPOINT_4_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_5(generation)
-#define MONO_GC_CHECKPOINT_5_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_6(generation)
-#define MONO_GC_CHECKPOINT_6_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_7(generation)
-#define MONO_GC_CHECKPOINT_7_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_8(generation)
-#define MONO_GC_CHECKPOINT_8_ENABLED() (0)
-
-#define MONO_GC_CHECKPOINT_9(generation)
-#define MONO_GC_CHECKPOINT_9_ENABLED() (0)
-
-
 #define MONO_GC_CONCURRENT_START_BEGIN(generation)
 #define MONO_GC_CONCURRENT_START_BEGIN_ENABLED()       (0)
 
-#define MONO_GC_CONCURRENT_START_END(generation,num_major_objects_marked)
-#define MONO_GC_CONCURRENT_START_END_ENABLED() (0)
-
 #define MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN(generation,num_major_objects_marked)
 #define MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN_ENABLED()       (0)
 
-#define MONO_GC_CONCURRENT_UPDATE_END(generation,num_major_objects_marked)
-#define MONO_GC_CONCURRENT_UPDATE_END_ENABLED()        (0)
-
-#define MONO_GC_CONCURRENT_FINISH_END(generation,num_major_objects_marked)
-#define MONO_GC_CONCURRENT_FINISH_END_ENABLED()        (0)
-
-
 #define MONO_GC_SWEEP_BEGIN(generation,full_sweep)
 #define MONO_GC_SWEEP_BEGIN_ENABLED()  (0)
 
 #define MONO_GC_WORLD_RESTART_END_ENABLED()    (0)
 
 
-#define MONO_GC_HEAP_ALLOC(addr,size)
-#define MONO_GC_HEAP_ALLOC_ENABLED()   (0)
-
-#define MONO_GC_HEAP_FREE(addr,size)
-#define MONO_GC_HEAP_FREE_ENABLED()    (0)
-
-
-#define MONO_GC_LOCKED()
-#define MONO_GC_LOCKED_ENABLED() (0)
-
-#define MONO_GC_UNLOCKED()
-#define MONO_GC_UNLOCKED_ENABLED() (0)
-
-
 #define MONO_GC_NURSERY_TLAB_ALLOC(addr,len)
 #define MONO_GC_NURSERY_TLAB_ALLOC_ENABLED()   (0)
 
 #define MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED(addr,size,ns_name,class_name)
 #define MONO_GC_MAJOR_OBJ_ALLOC_DEGRADED_ENABLED()     (0)
 
-#define MONO_GC_MAJOR_OBJ_ALLOC_MATURE(addr,size,ns_name,class_name)
-#define MONO_GC_MAJOR_OBJ_ALLOC_MATURE_ENABLED()       (0)
-
 
 #define MONO_GC_OBJ_MOVED(dest,src,dest_gen,src_gen,size,ns_name,class_name)
 #define MONO_GC_OBJ_MOVED_ENABLED()    (0)
 #define MONO_GC_FINALIZE_INVOKE_ENABLED()      (0)
 
 
-#define MONO_GC_WEAK_UPDATE(ref_addr,old_addr,new_addr,size,ns_name,class_name,track)
+#define MONO_GC_WEAK_UPDATE(ref_addr,new_addr,size,ns_name,class_name,track)
 #define MONO_GC_WEAK_UPDATE_ENABLED()  (0)
 
 
 #define MONO_GC_OBJ_CEMENTED(addr,size,ns_name,class_name)
 #define MONO_GC_OBJ_CEMENTED_ENABLED() (0)
 
-
-#define MONO_GC_INTERNAL_ALLOC(addr,size,type)
-#define MONO_GC_INTERNAL_ALLOC_ENABLED()       (0)
-
-#define MONO_GC_INTERNAL_DEALLOC(addr,size,type)
-#define MONO_GC_INTERNAL_DEALLOC_ENABLED()     (0)
-
 #endif
 
 #endif