Set thread affinity with +RTS -qa (only on Linux so far)
[ghc-hetmet.git] / includes / RtsFlags.h
index 17d2363..348a8f5 100644 (file)
@@ -39,17 +39,20 @@ struct GC_FLAGS {
     rtsBool compact;           /* True <=> "compact all the time" */
     double  compactThreshold;
 
+    rtsBool sweep;             /* use "mostly mark-sweep" instead of copying
+                                 * for the oldest generation */
     rtsBool ringBell;
     rtsBool frontpanel;
 
-    int idleGCDelayTicks;      /* in milliseconds */
+    int idleGCDelayTime;       /* in milliseconds */
+
+    StgWord heapBase;           /* address to ask the OS for memory */
 };
 
 struct DEBUG_FLAGS {  
     /* flags to control debugging output & extra checking in various subsystems */
     rtsBool scheduler;      /* 's' */
     rtsBool interpreter;    /* 'i' */
-    rtsBool codegen;        /* 'c' */
     rtsBool weak;           /* 'w' */
     rtsBool gccafs;         /* 'G' */
     rtsBool gc;             /* 'g' */
@@ -57,12 +60,15 @@ struct DEBUG_FLAGS {
     rtsBool sanity;         /* 'S'   warning: might be expensive! */
     rtsBool stable;         /* 't' */
     rtsBool prof;           /* 'p' */
+    rtsBool eventlog;       /* 'e' */
     rtsBool gran;           /* 'r' */
     rtsBool par;            /* 'P' */
     rtsBool linker;         /* 'l'   the object linker */
     rtsBool apply;          /* 'a' */
     rtsBool stm;            /* 'm' */
     rtsBool squeeze;        /* 'z'  stack squeezing & lazy blackholing */
+    rtsBool hpc;           /* 'c' coverage */
+    rtsBool timestamp;          /* add timestamps to traces */
 };
 
 struct COST_CENTRE_FLAGS {
@@ -86,8 +92,7 @@ struct PROFILING_FLAGS {
 # define HEAP_BY_RETAINER       6
 # define HEAP_BY_LDV            7
 
-# define HEAP_BY_INFOPTR        1      /* DEBUG only */
-# define HEAP_BY_CLOSURE_TYPE   2      /* DEBUG only */
+# define HEAP_BY_CLOSURE_TYPE   8
 
     nat                 profileInterval;      /* delta between samples (in ms) */
     nat                 profileIntervalTicks; /* delta between samples (in 'ticks') */
@@ -98,6 +103,8 @@ struct PROFILING_FLAGS {
 
     nat                 maxRetainerSetSize;
 
+    nat                 ccsLength;
+
     char*               modSelector;
     char*               descrSelector;
     char*               typeSelector;
@@ -108,11 +115,25 @@ struct PROFILING_FLAGS {
 
 };
 
+#ifdef EVENTLOG
+struct EVENTLOG_FLAGS {
+  rtsBool doEventLogging;
+};
+#endif
+
 struct CONCURRENT_FLAGS {
     int ctxtSwitchTime;                /* in milliseconds */
     int ctxtSwitchTicks;       /* derived */
 };
 
+struct MISC_FLAGS {
+    int tickInterval;     /* in milliseconds */
+    rtsBool install_signal_handlers;
+    rtsBool machineReadable;
+    StgWord linkerMemBase;       /* address to ask the OS for memory
+                                  * for the linker, NULL ==> off */
+};
+
 #ifdef PAR
 /* currently the same as GRAN_STATS_FLAGS */
 struct PAR_STATS_FLAGS {
@@ -167,6 +188,11 @@ struct PAR_FLAGS {
   rtsBool        migrate;        /* migrate threads between capabilities */
   rtsBool        wakeupMigrate;  /* migrate a thread on wakeup */
   unsigned int  maxLocalSparks;
+  rtsBool        parGcEnabled;   /* enable parallel GC */
+  rtsBool        parGcGen;       /* do parallel GC in this generation
+                                  * and higher only */
+  rtsBool        parGcLoadBalancing; /* do load-balancing in parallel GC */
+  rtsBool        setAffinity;    /* force thread affinity with CPUs */
 };
 #endif /* THREADED_RTS */
 
@@ -290,6 +316,23 @@ struct TICKY_FLAGS {
     FILE   *tickyFile;
 };
 
+#ifdef USE_PAPI
+#define MAX_PAPI_USER_EVENTS 8
+
+struct PAPI_FLAGS {
+    nat     eventType;          /* The type of events to count */
+    nat     numUserEvents;
+    char *  userEvents[MAX_PAPI_USER_EVENTS];
+};
+
+#define PAPI_FLAG_CACHE_L1 1
+#define PAPI_FLAG_CACHE_L2 2
+#define PAPI_FLAG_BRANCH 3
+#define PAPI_FLAG_STALLS 4
+#define PAPI_FLAG_CB_EVENTS 5
+#define PAPI_USER_EVENTS 6
+
+#endif
 
 /* Put them together: */
 
@@ -297,9 +340,13 @@ typedef struct _RTS_FLAGS {
     /* The first portion of RTS_FLAGS is invariant. */
     struct GC_FLAGS         GcFlags;
     struct CONCURRENT_FLAGS  ConcFlags;
+    struct MISC_FLAGS        MiscFlags;
     struct DEBUG_FLAGS      DebugFlags;
     struct COST_CENTRE_FLAGS CcFlags;
     struct PROFILING_FLAGS   ProfFlags;
+#ifdef EVENTLOG
+    struct EVENTLOG_FLAGS    EventLogFlags;
+#endif
     struct TICKY_FLAGS      TickyFlags;
 
 #if defined(THREADED_RTS) || defined(PAR)
@@ -308,6 +355,9 @@ typedef struct _RTS_FLAGS {
 #ifdef GRAN
     struct GRAN_FLAGS  GranFlags;
 #endif
+#ifdef USE_PAPI
+    struct PAPI_FLAGS   PapiFlags;
+#endif
 } RTS_FLAGS;
 
 #ifdef COMPILING_RTS_MAIN