Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mono/metadata/sgen-gc.c8
-rw-r--r--mono/metadata/sgen-protocol.c48
-rw-r--r--mono/metadata/sgen-protocol.h42
-rw-r--r--tools/sgen/sgen-grep-binprot.c15
4 files changed, 64 insertions, 49 deletions
diff --git a/mono/metadata/sgen-gc.c b/mono/metadata/sgen-gc.c
index b6f98ff4b69..a93194cc0b2 100644
--- a/mono/metadata/sgen-gc.c
+++ b/mono/metadata/sgen-gc.c
@@ -2401,6 +2401,7 @@ collect_nursery (void)
return TRUE;
MONO_GC_BEGIN (GENERATION_NURSERY);
+ binary_protocol_collection_begin (stat_minor_gcs, GENERATION_NURSERY);
verify_nursery ();
@@ -2416,7 +2417,6 @@ collect_nursery (void)
reset_pinned_from_failed_allocation ();
- binary_protocol_collection (stat_minor_gcs, GENERATION_NURSERY);
check_scan_starts ();
sgen_nursery_alloc_prepare_for_minor ();
@@ -2634,12 +2634,13 @@ collect_nursery (void)
objects_pinned = 0;
MONO_GC_END (GENERATION_NURSERY);
+ binary_protocol_collection_end (stat_minor_gcs - 1, GENERATION_NURSERY);
return needs_major;
}
static void
-major_copy_or_mark_from_roots (int *old_next_pin_slot, gboolean finish_up_concurrent_mark)
+major_copy_or_mark_from_roots (int *old_next_pin_slot, gboolean finish_up_concurrent_mark, gboolean scan_mod_union)
{
LOSObject *bigobj;
TV_DECLARE (atv);
@@ -2845,6 +2846,7 @@ static void
major_start_collection (int *old_next_pin_slot)
{
MONO_GC_BEGIN (GENERATION_OLD);
+ binary_protocol_collection_begin (stat_major_gcs, GENERATION_OLD);
current_collection_generation = GENERATION_OLD;
#ifndef DISABLE_PERFCOUNTERS
@@ -2863,7 +2865,6 @@ major_start_collection (int *old_next_pin_slot)
//count_ref_nonref_objs ();
//consistency_check ();
- binary_protocol_collection (stat_major_gcs, GENERATION_OLD);
check_scan_starts ();
degraded_mode = 0;
@@ -3028,6 +3029,7 @@ major_finish_collection (const char *reason, int old_next_pin_slot)
//consistency_check ();
MONO_GC_END (GENERATION_OLD);
+ binary_protocol_collection_end (stat_major_gcs - 1, GENERATION_OLD);
}
static gboolean
diff --git a/mono/metadata/sgen-protocol.c b/mono/metadata/sgen-protocol.c
index 9a585c4ecc5..07faabe1a61 100644
--- a/mono/metadata/sgen-protocol.c
+++ b/mono/metadata/sgen-protocol.c
@@ -1,25 +1,23 @@
/*
+ * sgen-protocol.c: Binary protocol of internal activity, to aid
+ * debugging.
+ *
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Copyright (C) 2012 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_SGEN_GC
@@ -153,11 +151,19 @@ protocol_entry (unsigned char type, gpointer data, int size)
}
void
-binary_protocol_collection (int index, int generation)
+binary_protocol_collection_begin (int index, int generation)
{
SGenProtocolCollection entry = { index, generation };
binary_protocol_flush_buffers (FALSE);
- protocol_entry (SGEN_PROTOCOL_COLLECTION, &entry, sizeof (SGenProtocolCollection));
+ protocol_entry (SGEN_PROTOCOL_COLLECTION_BEGIN, &entry, sizeof (SGenProtocolCollection));
+}
+
+void
+binary_protocol_collection_end (int index, int generation)
+{
+ SGenProtocolCollection entry = { index, generation };
+ binary_protocol_flush_buffers (FALSE);
+ protocol_entry (SGEN_PROTOCOL_COLLECTION_END, &entry, sizeof (SGenProtocolCollection));
}
void
diff --git a/mono/metadata/sgen-protocol.h b/mono/metadata/sgen-protocol.h
index 29373afffdc..2f2420d2ad1 100644
--- a/mono/metadata/sgen-protocol.h
+++ b/mono/metadata/sgen-protocol.h
@@ -1,25 +1,23 @@
/*
+ * sgen-protocol.h: Binary protocol of internal activity, to aid
+ * debugging.
+ *
* Copyright 2001-2003 Ximian, Inc
* Copyright 2003-2010 Novell, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Copyright (C) 2012 Xamarin Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License 2.0 as published by the Free Software Foundation;
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License 2.0 along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "sgen-gc.h"
@@ -27,7 +25,8 @@
#ifdef SGEN_BINARY_PROTOCOL
enum {
- SGEN_PROTOCOL_COLLECTION,
+ SGEN_PROTOCOL_COLLECTION_BEGIN,
+ SGEN_PROTOCOL_COLLECTION_END,
SGEN_PROTOCOL_ALLOC,
SGEN_PROTOCOL_COPY,
SGEN_PROTOCOL_PIN,
@@ -138,7 +137,8 @@ gboolean binary_protocol_is_enabled (void) MONO_INTERNAL;
void binary_protocol_flush_buffers (gboolean force) MONO_INTERNAL;
-void binary_protocol_collection (int index, int generation) MONO_INTERNAL;
+void binary_protocol_collection_begin (int index, int generation) MONO_INTERNAL;
+void binary_protocol_collection_end (int index, int generation) MONO_INTERNAL;
void binary_protocol_alloc (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_alloc_degraded (gpointer obj, gpointer vtable, int size) MONO_INTERNAL;
diff --git a/tools/sgen/sgen-grep-binprot.c b/tools/sgen/sgen-grep-binprot.c
index 2195f4ff3fb..66d307e2f9d 100644
--- a/tools/sgen/sgen-grep-binprot.c
+++ b/tools/sgen/sgen-grep-binprot.c
@@ -19,7 +19,8 @@ read_entry (FILE *in, void **data)
if (fread (&type, 1, 1, in) != 1)
return SGEN_PROTOCOL_EOF;
switch (type) {
- case SGEN_PROTOCOL_COLLECTION: size = sizeof (SGenProtocolCollection); break;
+ case SGEN_PROTOCOL_COLLECTION_BEGIN: size = sizeof (SGenProtocolCollection); break;
+ case SGEN_PROTOCOL_COLLECTION_END: size = sizeof (SGenProtocolCollection); break;
case SGEN_PROTOCOL_ALLOC: size = sizeof (SGenProtocolAlloc); break;
case SGEN_PROTOCOL_ALLOC_PINNED: size = sizeof (SGenProtocolAlloc); break;
case SGEN_PROTOCOL_ALLOC_DEGRADED: size = sizeof (SGenProtocolAlloc); break;
@@ -50,9 +51,14 @@ static void
print_entry (int type, void *data)
{
switch (type) {
- case SGEN_PROTOCOL_COLLECTION: {
+ case SGEN_PROTOCOL_COLLECTION_BEGIN: {
SGenProtocolCollection *entry = data;
- printf ("collection %d generation %d\n", entry->index, entry->generation);
+ printf ("collection begin %d generation %d\n", entry->index, entry->generation);
+ break;
+ }
+ case SGEN_PROTOCOL_COLLECTION_END: {
+ SGenProtocolCollection *entry = data;
+ printf ("collection end %d generation %d\n", entry->index, entry->generation);
break;
}
case SGEN_PROTOCOL_ALLOC: {
@@ -152,7 +158,8 @@ static gboolean
is_match (gpointer ptr, int type, void *data)
{
switch (type) {
- case SGEN_PROTOCOL_COLLECTION:
+ case SGEN_PROTOCOL_COLLECTION_BEGIN:
+ case SGEN_PROTOCOL_COLLECTION_END:
case SGEN_PROTOCOL_THREAD_SUSPEND:
case SGEN_PROTOCOL_THREAD_RESTART:
case SGEN_PROTOCOL_THREAD_REGISTER: