[project @ 1996-01-11 14:06:51 by partain]
[ghc-hetmet.git] / ghc / includes / RtsFlags.lh
1 \begin{code}
2 #ifndef RTSFLAGS_H
3 #define RTSFLAGS_H
4 \end{code}
5
6 For defaults, see the @initRtsFlagsDefaults@ routine.
7
8 \begin{code}
9 struct GC_FLAGS {
10     FILE   *statsFile;
11     I_      giveStats; /* ToDo: replace with enum type? */
12 #define NO_GC_STATS      0
13 #define VERBOSE_GC_STATS 1
14
15     I_      stksSize; /* this size is stored to record number of *words* */
16     I_      heapSize; /* this size is stored to record number of *words* */
17     I_      allocAreaSize;
18     rtsBool allocAreaSizeGiven;
19     I_      specifiedOldGenSize; /* zero => use the rest of the heap */
20     double  pcFreeHeap;
21     I_      minAllocAreaSize; /* derived from: pcFreeHeap, heap-size */
22
23     rtsBool force2s; /* force the use of 2-space copying collection;
24                         forced to rtsTrue if we do *heap* profiling.
25                      */
26     rtsBool forceGC; /* force a major GC every <interval> bytes */
27     I_      forcingInterval; /* actually, stored as a number of *words* */
28     rtsBool ringBell;
29     W_      trace;
30             /* bit  1 set: chatty GC summaries
31                     2 set: details of minor collections
32                     4 set: details of major collections, except marking
33                     8 set: ditto, but marking this time
34                    16 set: GC of MallocPtrs
35                    32 set: GC of Concurrent things
36             */
37 #define DEBUG_TRACE_MINOR_GC    2
38 #define DEBUG_TRACE_MAJOR_GC    4
39 #define DEBUG_TRACE_MARKING     8
40 #define DEBUG_TRACE_MALLOCPTRS 16
41 #define DEBUG_TRACE_CONCURRENT 32
42
43     rtsBool lazyBlackHoling;
44     rtsBool doSelectorsAtGC;
45     rtsBool squeezeUpdFrames;
46 };
47
48 struct DEBUG_FLAGS {
49 };
50
51 #if defined(PROFILING) || defined(PAR)
52     /* with PROFILING, full cost-centre stuff (also PROFILING_FLAGS);
53        with PAR, just the four fixed cost-centres.
54     */
55 struct COST_CENTRE_FLAGS {
56     W_      doCostCentres;
57 # define COST_CENTRES_SUMMARY   1
58 # define COST_CENTRES_VERBOSE   2 /* incl. serial time profile */
59 # define COST_CENTRES_ALL       3
60
61     char    sortBy;
62 # define SORTCC_LABEL   'C'
63 # define SORTCC_TIME    'T'
64 # define SORTCC_ALLOC   'A'
65
66     I_      ctxtSwitchTicks; /* derived */
67     I_      profilerTicks;   /* derived */
68     I_      msecsPerTick;    /* derived */
69 };
70 #endif
71
72 #ifdef PROFILING
73 struct PROFILING_FLAGS {
74     W_  doHeapProfile;
75 # define NO_HEAP_PROFILING      0       /* N.B. Used as indexes into arrays */
76 # define HEAP_BY_CC             1
77 # define HEAP_BY_MOD            2
78 # define HEAP_BY_GRP            3
79 # define HEAP_BY_DESCR          4
80 # define HEAP_BY_TYPE           5
81 # define HEAP_BY_TIME           6
82   
83 # define CCchar    'C'
84 # define MODchar   'M'
85 # define GRPchar   'G'
86 # define DESCRchar 'D'
87 # define TYPEchar  'Y'
88 # define TIMEchar  'T'
89 };
90 #endif
91
92 #ifdef CONCURRENT
93 struct CONCURRENT_FLAGS {
94     I_      ctxtSwitchTime; /* in milliseconds */
95     I_      maxThreads;
96     I_      stkChunkSize;
97     I_      maxLocalSparks;
98 };
99 #endif /* CONCURRENT */
100
101 #ifdef PAR
102 struct PAR_FLAGS {
103     rtsBool parallelStats;      /* Gather parallel statistics */
104     rtsBool granSimStats;       /* Full .gr profile (rtsTrue) or only END events? */
105     rtsBool granSimStats_Binary;
106
107     rtsBool outputDisabled;     /* Disable output for performance purposes */
108     
109     W_      packBufferSize;
110 };
111
112 #endif /* PAR */
113
114 #ifdef GRAN
115 struct GRAN_FLAGS {
116 };
117 #endif /* GRAN */
118
119 #ifdef TICKY_TICKY
120 struct TICKY_FLAGS {
121     rtsBool showTickyStats;
122     FILE   *tickyFile;
123
124     /* see also: doUpdEntryCounts in AllFlags */
125 };
126 #endif /* TICKY_TICKY */
127 \end{code}
128
129 Put them together:
130 \begin{code}
131 struct RTS_FLAGS {
132     struct GC_FLAGS     GcFlags;
133     struct DEBUG_FLAGS  DebugFlags; /* unused at present */
134
135 #if defined(PROFILING) || defined(PAR)
136     struct COST_CENTRE_FLAGS CcFlags;
137 #endif
138 #ifdef PROFILING
139     struct PROFILING_FLAGS ProfFlags;
140 #endif
141 #ifdef CONCURRENT
142     struct CONCURRENT_FLAGS ConcFlags;
143 #endif
144 #ifdef PAR
145     struct PAR_FLAGS    ParFlags;
146 #endif
147 #ifdef GRAN
148     struct GRAN_FLAGS   GranFlags;
149 #endif
150 #ifdef TICKY_TICKY
151     struct TICKY_FLAGS  TickyFlags;
152 #endif
153 };
154
155 extern struct RTS_FLAGS RTSflags;
156 \end{code}
157
158 Routines that operate-on/to-do-with RTS flags:
159 \begin{code}
160 void    initRtsFlagsDefaults (STG_NO_ARGS);
161 void    setupRtsFlags PROTO((int *argc,     char *argv[],
162                              int *rts_argc, char *rts_argv[]));
163 \end{code}
164
165 OLD: This is the maximum identifier length that can be used for a cost
166 centre or description string. It includes the terminating null
167 character.
168
169 The printf formats are here, so we are less likely to make overly-long
170 filenames (with disastrous results).  No more than 128 chars, please!
171
172 \begin{code}
173 #define STATS_FILENAME_MAXLEN   128
174
175 #define GR_FILENAME_FMT         "%0.124s.gr"
176 #define GR_FILENAME_FMT_GUM     "%0.120s.%03d.%s"
177 #define HP_FILENAME_FMT         "%0.124s.hp"
178 #define LIFE_FILENAME_FMT       "%0.122s.life"
179 #define PROF_FILENAME_FMT       "%0.122s.prof"
180 #define PROF_FILENAME_FMT_GUM   "%0.118s.%03d.prof"
181 #define QP_FILENAME_FMT         "%0.124s.qp"
182 #define STAT_FILENAME_FMT       "%0.122s.stat"
183 #define TICKY_FILENAME_FMT      "%0.121s.ticky"
184 #define TIME_FILENAME_FMT       "%0.122s.time"
185 #define TIME_FILENAME_FMT_GUM   "%0.118s.%03d.time"
186 \end{code}
187
188 Multi-slurp protection:
189 \begin{code}
190 #endif  /* RTSFLAGS_H */
191 \end{code}