Skip to content

Commit

Permalink
[dtrace] GC begin/end probes for SGen.
Browse files Browse the repository at this point in the history
  • Loading branch information
schani committed Sep 28, 2012
1 parent bc561b1 commit a3c37cd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mono/metadata/sgen-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
#include "utils/mono-proclib.h"
#include "utils/mono-memory-model.h"
#include "utils/mono-logger-internal.h"
#include "utils/dtrace.h"

#include <mono/utils/mono-logger-internal.h>
#include <mono/utils/memcheck.h>
Expand Down Expand Up @@ -2351,6 +2352,8 @@ collect_nursery (void)
if (disable_minor_collections)
return TRUE;

MONO_PROBE_GC_BEGIN (GENERATION_NURSERY);

verify_nursery ();

mono_perfcounters->gc_collections0++;
Expand Down Expand Up @@ -2571,6 +2574,8 @@ collect_nursery (void)
current_collection_generation = -1;
objects_pinned = 0;

MONO_PROBE_GC_END (GENERATION_NURSERY);

return needs_major;
}

Expand All @@ -2592,6 +2597,8 @@ major_do_collection (const char *reason)
ScanThreadDataJobData stdjd;
ScanFinalizerEntriesJobData sfejd_fin_ready, sfejd_critical_fin;

MONO_PROBE_GC_BEGIN (GENERATION_OLD);

current_collection_generation = GENERATION_OLD;
mono_perfcounters->gc_collections1++;

Expand Down Expand Up @@ -2878,6 +2885,8 @@ major_do_collection (const char *reason)

//consistency_check ();

MONO_PROBE_GC_END (GENERATION_OLD);

return bytes_pinned_from_failed_allocation > 0;
}

Expand Down

0 comments on commit a3c37cd

Please sign in to comment.