+struct GRAN_STATS_FLAGS {
+ rtsBool Full; /* Full .gr profile (rtsTrue) or only END events? */
+ rtsBool Suppressed; /* No .gr profile at all */
+ rtsBool Binary; /* Binary profile? (not yet implemented) */
+ rtsBool Sparks; /* Info on sparks in profile? */
+ rtsBool Heap; /* Info on heap allocs in profile? */
+ rtsBool NewLogfile; /* Use new log-file format? (not yet implemented) */
+ rtsBool Global; /* Global statistics? (printed on shutdown; no log file) */
+};
+
+struct GRAN_COST_FLAGS {
+ /* Communication Cost Variables -- set in main program */
+ nat latency; /* Latency for single packet */
+ nat additional_latency; /* Latency for additional packets */
+ nat fetchtime;
+ nat lunblocktime; /* Time for local unblock */
+ nat gunblocktime; /* Time for global unblock */
+ nat mpacktime; /* Cost of creating a packet */
+ nat munpacktime; /* Cost of receiving a packet */
+ nat mtidytime; /* Cost of cleaning up after send */
+
+ nat threadcreatetime; /* Thread creation costs */
+ nat threadqueuetime; /* Cost of adding a thread to the running/runnable queue */
+ nat threaddescheduletime; /* Cost of descheduling a thread */
+ nat threadscheduletime; /* Cost of scheduling a thread */
+ nat threadcontextswitchtime; /* Cost of context switch */
+
+ /* Instruction Costs */
+ nat arith_cost; /* arithmetic instructions (+,i,< etc) */
+ nat branch_cost; /* branch instructions */
+ nat load_cost; /* load into register */
+ nat store_cost; /* store into memory */
+ nat float_cost; /* floating point operations */
+
+ nat heapalloc_cost; /* heap allocation costs */
+
+ /* Overhead for granularity control mechanisms */
+ /* overhead per elem of spark queue */
+ nat pri_spark_overhead;
+ /* overhead per elem of thread queue */
+ nat pri_sched_overhead;
+};
+
+struct GRAN_DEBUG_FLAGS {
+ /* flags to control debugging output in various subsystems */
+ rtsBool event_trace : 1; /* 1 */
+ rtsBool event_stats : 1; /* 2 */
+ rtsBool bq : 1; /* 4 */
+ rtsBool pack : 1; /* 8 */
+ rtsBool checkSparkQ : 1; /* 16 */
+ rtsBool thunkStealing : 1; /* 32 */
+ rtsBool randomSteal : 1; /* 64 */
+ rtsBool findWork : 1; /* 128 */
+ rtsBool unused : 1; /* 256 */
+ rtsBool pri : 1; /* 512 */
+ rtsBool checkLight : 1; /* 1024 */
+ rtsBool sortedQ : 1; /* 2048 */
+ rtsBool blockOnFetch : 1; /* 4096 */
+ rtsBool packBuffer : 1; /* 8192 */
+ rtsBool blockOnFetch_sanity : 1; /* 16384 */
+};
+
+#define MAX_GRAN_DEBUG_OPTION 14
+#define GRAN_DEBUG_MASK(n) ((nat)(ldexp(1,n)))
+#define MAX_GRAN_DEBUG_MASK ((nat)(ldexp(1,(MAX_GRAN_DEBUG_OPTION+1))-1))
+