summaryrefslogtreecommitdiff
path: root/includes/RtsAPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/RtsAPI.h')
-rw-r--r--includes/RtsAPI.h43
1 files changed, 40 insertions, 3 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index 1ed5fb06f0..79c4d8ef53 100644
--- a/includes/RtsAPI.h
+++ b/includes/RtsAPI.h
@@ -53,6 +53,8 @@ typedef struct CapabilityPublic_ {
typedef enum {
RtsOptsNone, // +RTS causes an error
+ RtsOptsIgnore, // Ignore command line arguments
+ RtsOptsIgnoreAll, // Ignore command line and Environment arguments
RtsOptsSafeOnly, // safe RTS options allowed; others cause an error
RtsOptsAll // all RTS options allowed
} RtsOptsEnabledEnum;
@@ -100,6 +102,10 @@ typedef struct {
// Called for every GC
void (* gcDoneHook) (const struct GCDetails_ *stats);
+
+ // Called when GC sync takes too long (+RTS --long-gc-sync=<time>)
+ void (* longGCSync) (uint32_t this_cap, Time time_ns);
+ void (* longGCSyncEnd) (Time time_ns);
} RtsConfig;
// Clients should start with defaultRtsConfig and then customise it.
@@ -121,7 +127,9 @@ typedef struct GCDetails_ {
uint32_t threads;
// Number of bytes allocated since the previous GC
uint64_t allocated_bytes;
- // Total amount of live data in the heap (incliudes large + compact data)
+ // Total amount of live data in the heap (incliudes large + compact data).
+ // Updated after every GC. Data in uncollected generations (in minor GCs)
+ // are considered live.
uint64_t live_bytes;
// Total amount of live data in large objects
uint64_t large_objects_bytes;
@@ -159,7 +167,8 @@ typedef struct _RTSStats {
uint32_t major_gcs;
// Total bytes allocated
uint64_t allocated_bytes;
- // Maximum live data (including large objects + compact regions)
+ // Maximum live data (including large objects + compact regions) in the
+ // heap. Updated after a major GC.
uint64_t max_live_bytes;
// Maximum live data in large objects
uint64_t max_large_objects_bytes;
@@ -178,7 +187,7 @@ typedef struct _RTSStats {
uint64_t par_copied_bytes;
// Sum of par_max_copied_bytes across all parallel GCs
uint64_t cumulative_par_max_copied_bytes;
- // Sum of par_balanced_copied_byes across all parallel GCs.
+ // Sum of par_balanced_copied_byes across all parallel GCs.
uint64_t cumulative_par_balanced_copied_bytes;
// -----------------------------------
@@ -186,6 +195,10 @@ typedef struct _RTSStats {
// (we use signed values here because due to inaccuracies in timers
// the values can occasionally go slightly negative)
+ // Total CPU time used by the init phase
+ Time init_cpu_ns;
+ // Total elapsed time used by the init phase
+ Time init_elapsed_ns;
// Total CPU time used by the mutator
Time mutator_cpu_ns;
// Total elapsed time used by the mutator
@@ -204,6 +217,30 @@ typedef struct _RTSStats {
GCDetails gc;
+ // -----------------------------------
+ // Internal Counters
+
+ // The number of times a GC thread spun on its 'gc_spin' lock.
+ // Will be zero if the rts was not built with PROF_SPIN
+ uint64_t gc_spin_spin;
+ // The number of times a GC thread yielded on its 'gc_spin' lock.
+ // Will be zero if the rts was not built with PROF_SPIN
+ uint64_t gc_spin_yield;
+ // The number of times a GC thread spun on its 'mut_spin' lock.
+ // Will be zero if the rts was not built with PROF_SPIN
+ uint64_t mut_spin_spin;
+ // The number of times a GC thread yielded on its 'mut_spin' lock.
+ // Will be zero if the rts was not built with PROF_SPIN
+ uint64_t mut_spin_yield;
+ // The number of times a GC thread has checked for work across all parallel
+ // GCs
+ uint64_t any_work;
+ // The number of times a GC thread has checked for work and found none
+ // across all parallel GCs
+ uint64_t no_work;
+ // The number of times a GC thread has iterated it's outer loop across all
+ // parallel GCs
+ uint64_t scav_find_work;
} RTSStats;
void getRTSStats (RTSStats *s);