[project @ 1999-11-02 15:05:38 by simonmar]
[ghc-hetmet.git] / ghc / rts / RtsFlags.c
index 1615934..eac04b1 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.15 1999/08/25 16:11:50 simonmar Exp $
+ * $Id: RtsFlags.c,v 1.20 1999/11/02 15:06:00 simonmar Exp $
  *
  * (c) The AQUA Project, Glasgow University, 1994-1997
  * (c) The GHC Team, 1998-1999
 #include "BlockAlloc.h"
 #include "ProfRts.h"
 
+#if defined(PROFILING) 
+#include "Itimer.h"
+#endif
+
 #if HAVE_STDLIB_H
 #include <stdlib.h>
 #endif
@@ -98,6 +102,9 @@ void initRtsFlagsDefaults(void)
 #endif
 
     RtsFlags.ConcFlags.ctxtSwitchTime  = CS_MIN_MILLISECS;  /* In milliseconds */
+#ifdef SMP
+    RtsFlags.ConcFlags.nNodes  = 1;
+#endif
 #ifdef PAR
     RtsFlags.ParFlags.parallelStats    = rtsFalse;
     RtsFlags.ParFlags.granSimStats     = rtsFalse;
@@ -220,7 +227,7 @@ usage_text[] = {
 # if defined(PROFILING)
 "",
 "  -h<break-down> Heap residency profile      (output file <program>.hp)",
-"     break-down: C = cost centre (default), M = module, G = group",
+"     break-down: C = cost centre stack (default), M = module, G = group",
 "                 D = closure description, Y = type description",
 "                 T<ints>,<start> = time closure created",
 "                    ints:  no. of interval bands plotted (default 18)",
@@ -263,6 +270,9 @@ usage_text[] = {
 "  -C<secs>  Context-switch interval in seconds",
 "                (0 or no argument means switch as often as possible)",
 "                the default is .01 sec; resolution is .01 sec",
+# ifdef SMP
+"  -N<n>     Use <n> OS threads (default: 1)",
+# endif
 # ifdef PAR
 "  -q        Enable activity profile (output files in ~/<program>*.gr)",
 "  -qb       Enable binary activity profile (output file /tmp/<program>.gb)",
@@ -575,7 +585,7 @@ error = rtsTrue;
                switch (rts_argv[arg][2]) {
                  case '\0':
                  case CCchar:
-                   RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CC;
+                   RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CCS;
                    break;
                  case MODchar:
                    RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_MOD;
@@ -714,6 +724,18 @@ error = rtsTrue;
                }
                break;
 
+#ifdef SMP
+             case 'N':
+               if (rts_argv[arg][2] != '\0') {
+                   RtsFlags.ConcFlags.nNodes
+                     = strtol(rts_argv[arg]+2, (char **) NULL, 10);
+                   if (RtsFlags.ConcFlags.nNodes <= 0) {
+                       fprintf(stderr, "setupRtsFlags: bad value for -N\n");
+                       error = rtsTrue;
+                   }
+               }
+               break;
+#endif
              /* =========== PARALLEL =========================== */
              case 'e':
                PAR_BUILD_ONLY(