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--libgc/include/gc.h1
-rw-r--r--mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs10
-rw-r--r--mono/metadata/boehm-gc.c39
-rw-r--r--mono/metadata/profiler.h9
-rw-r--r--mono/metadata/sgen-client-mono.h4
-rw-r--r--mono/profiler/log.h1
-rw-r--r--mono/profiler/mprof-report.c7
7 files changed, 40 insertions, 31 deletions
diff --git a/libgc/include/gc.h b/libgc/include/gc.h
index 7b1460a888a..e7929918ad0 100644
--- a/libgc/include/gc.h
+++ b/libgc/include/gc.h
@@ -93,7 +93,6 @@ GC_API GC_PTR (*GC_oom_fn) GC_PROTO((size_t bytes_requested));
/* pointer to a previously allocated heap */
/* object. */
-// Keep somewhat in sync with mono/metadata/profiler.h:enum MonoGCEvent
typedef enum {
GC_EVENT_START,
GC_EVENT_MARK_START,
diff --git a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs
index f34cafe07e0..01ce114093b 100644
--- a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs
+++ b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogEnums.cs
@@ -171,17 +171,13 @@ namespace Mono.Profiler.Log {
// mono/metadata/profiler.h : MonoProfilerGCEvent
public enum LogGCEvent {
- Begin = 0,
- MarkBegin = 1,
- MarkEnd = 2,
- ReclaimBegin = 3,
- ReclaimEnd = 4,
- End = 5,
PreStopWorld = 6,
+ PreStopWorldLocked = 10,
PostStopWorld = 7,
+ Begin = 0,
+ End = 5,
PreStartWorld = 8,
PostStartWorld = 9,
- PreStopWorldLocked = 10,
PostStartWorldUnlocked = 11,
}
diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c
index 9439ebfab06..bd853b21eb9 100644
--- a/mono/metadata/boehm-gc.c
+++ b/mono/metadata/boehm-gc.c
@@ -428,26 +428,31 @@ static gint64 gc_start_time;
static void
on_gc_notification (GC_EventType event)
{
- MonoProfilerGCEvent e = (MonoProfilerGCEvent)event;
+ MonoProfilerGCEvent e;
- switch (e) {
- case MONO_GC_EVENT_PRE_STOP_WORLD:
+ switch (event) {
+ case GC_EVENT_PRE_STOP_WORLD:
+ e = MONO_GC_EVENT_PRE_STOP_WORLD;
MONO_GC_WORLD_STOP_BEGIN ();
break;
- case MONO_GC_EVENT_POST_STOP_WORLD:
+ case GC_EVENT_POST_STOP_WORLD:
+ e = MONO_GC_EVENT_POST_STOP_WORLD;
MONO_GC_WORLD_STOP_END ();
break;
- case MONO_GC_EVENT_PRE_START_WORLD:
+ case GC_EVENT_PRE_START_WORLD:
+ e = MONO_GC_EVENT_PRE_START_WORLD;
MONO_GC_WORLD_RESTART_BEGIN (1);
break;
- case MONO_GC_EVENT_POST_START_WORLD:
+ case GC_EVENT_POST_START_WORLD:
+ e = MONO_GC_EVENT_POST_START_WORLD;
MONO_GC_WORLD_RESTART_END (1);
break;
- case MONO_GC_EVENT_START:
+ case GC_EVENT_START:
+ e = MONO_GC_EVENT_START;
MONO_GC_BEGIN (1);
#ifndef DISABLE_PERFCOUNTERS
if (mono_perfcounters)
@@ -457,7 +462,8 @@ on_gc_notification (GC_EventType event)
gc_start_time = mono_100ns_ticks ();
break;
- case MONO_GC_EVENT_END:
+ case GC_EVENT_END:
+ e = MONO_GC_EVENT_END;
MONO_GC_END (1);
#if defined(ENABLE_DTRACE) && defined(__sun__)
/* This works around a dtrace -G problem on Solaris.
@@ -483,14 +489,23 @@ on_gc_notification (GC_EventType event)
break;
}
- MONO_PROFILER_RAISE (gc_event, (e, 0));
+ switch (event) {
+ case GC_EVENT_MARK_START:
+ case GC_EVENT_MARK_END:
+ case GC_EVENT_RECLAIM_START:
+ case GC_EVENT_RECLAIM_END:
+ break;
+ default:
+ MONO_PROFILER_RAISE (gc_event, (e, 0));
+ break;
+ }
- switch (e) {
- case MONO_GC_EVENT_PRE_STOP_WORLD:
+ switch (event) {
+ case GC_EVENT_PRE_STOP_WORLD:
mono_thread_info_suspend_lock ();
MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED, 0));
break;
- case MONO_GC_EVENT_POST_START_WORLD:
+ case GC_EVENT_POST_START_WORLD:
mono_thread_info_suspend_unlock ();
MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_POST_START_WORLD_UNLOCKED, 0));
break;
diff --git a/mono/metadata/profiler.h b/mono/metadata/profiler.h
index e141dd6622d..263f6e6866c 100644
--- a/mono/metadata/profiler.h
+++ b/mono/metadata/profiler.h
@@ -229,18 +229,13 @@ typedef enum {
MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9,
} MonoProfilerCodeBufferType;
-// Keep somewhat in sync with libgc/include/gc.h : GC_EventType.
typedef enum {
- MONO_GC_EVENT_START = 0,
- MONO_GC_EVENT_MARK_START = 1,
- MONO_GC_EVENT_MARK_END = 2,
- MONO_GC_EVENT_RECLAIM_START = 3,
- MONO_GC_EVENT_RECLAIM_END = 4,
- MONO_GC_EVENT_END = 5,
MONO_GC_EVENT_PRE_STOP_WORLD = 6,
/* When this event arrives, the GC and suspend locks are acquired. */
MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
MONO_GC_EVENT_POST_STOP_WORLD = 7,
+ MONO_GC_EVENT_START = 0,
+ MONO_GC_EVENT_END = 5,
MONO_GC_EVENT_PRE_START_WORLD = 8,
/* When this event arrives, the GC and suspend locks are released. */
MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11,
diff --git a/mono/metadata/sgen-client-mono.h b/mono/metadata/sgen-client-mono.h
index d9a483898e7..e3cae00e7e6 100644
--- a/mono/metadata/sgen-client-mono.h
+++ b/mono/metadata/sgen-client-mono.h
@@ -383,25 +383,21 @@ sgen_client_binary_protocol_block_set_state (gpointer addr, size_t size, int old
static void G_GNUC_UNUSED
sgen_client_binary_protocol_mark_start (int generation)
{
- MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_MARK_START, generation));
}
static void G_GNUC_UNUSED
sgen_client_binary_protocol_mark_end (int generation)
{
- MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_MARK_END, generation));
}
static void G_GNUC_UNUSED
sgen_client_binary_protocol_reclaim_start (int generation)
{
- MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_RECLAIM_START, generation));
}
static void G_GNUC_UNUSED
sgen_client_binary_protocol_reclaim_end (int generation)
{
- MONO_PROFILER_RAISE (gc_event, (MONO_GC_EVENT_RECLAIM_END, generation));
}
static void
diff --git a/mono/profiler/log.h b/mono/profiler/log.h
index 41e294dc719..1979e8baab6 100644
--- a/mono/profiler/log.h
+++ b/mono/profiler/log.h
@@ -69,6 +69,7 @@
added an exception object field to TYPE_CLAUSE
class unload events no longer exist (they were never emitted)
removed type field from TYPE_SAMPLE_HIT
+ removed MONO_GC_EVENT_{MARK,RECLAIM}_{START,END}
*/
/*
diff --git a/mono/profiler/mprof-report.c b/mono/profiler/mprof-report.c
index 1c63e9abde7..4251a164ff5 100644
--- a/mono/profiler/mprof-report.c
+++ b/mono/profiler/mprof-report.c
@@ -906,6 +906,13 @@ enum {
SAMPLE_BRANCH_MISSES,
};
+enum {
+ MONO_GC_EVENT_MARK_START = 1,
+ MONO_GC_EVENT_MARK_END = 2,
+ MONO_GC_EVENT_RECLAIM_START = 3,
+ MONO_GC_EVENT_RECLAIM_END = 4,
+};
+
static const char*
sample_type_name (int type)
{