[project @ 2001-01-26 14:40:18 by simonmar]
[ghc-hetmet.git] / ghc / rts / RtsFlags.c
index 1a4effe..f8b8e99 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.32 2000/10/06 15:35:09 simonmar Exp $
+ * $Id: RtsFlags.c,v 1.36 2001/01/24 15:41:30 simonmar Exp $
  *
  * (c) The AQUA Project, Glasgow University, 1994-1997
  * (c) The GHC Team, 1998-1999
@@ -229,6 +229,9 @@ void initRtsFlagsDefaults(void)
     RtsFlags.GcFlags.steps              = 2;
 
     RtsFlags.GcFlags.squeezeUpdFrames  = rtsTrue;
+#ifdef RTS_GTK_FRONTPANEL
+    RtsFlags.GcFlags.frontpanel         = rtsFalse;
+#endif
 
 #if defined(PROFILING) || defined(PAR)
     RtsFlags.CcFlags.doCostCentres     = 0;
@@ -353,7 +356,7 @@ usage_text[] = {
 "",
 "The following run time system options are available:",
 "",
-"  -? -f    Prints this message and exits; the program is not executed",
+"  -?       Prints this message and exits; the program is not executed",
 "",
 "  -K<size> Sets the maximum stack size (default 1M)  Egs: -K32k   -K512k",
 "  -k<size> Sets the initial thread stack size (default 1k)  Egs: -K4k   -K2m",
@@ -364,8 +367,13 @@ usage_text[] = {
 "  -m<n>%   Minimum % of heap which must be available (default 3%)",
 "  -G<n>    Number of generations (default: 2)",
 "  -T<n>    Number of steps in younger generations (default: 2)",
-"  -s<file> Summary GC statistics   (default file: <program>.stat)",
-"  -S<file> Detailed GC statistics  (with -Sstderr going to stderr)",
+"",
+"  -t<file> One-line GC statistics  (default file: <program>.stat)",
+"  -s<file> Summary  GC statistics  (with -Sstderr going to stderr)",
+"  -S<file> Detailed GC statistics",
+#ifdef RTS_GTK_FRONTPANEL
+"  -f       Display front panel (requires X11 & GTK+)",
+#endif
 "",
 "",
 "  -Z       Don't squeeze out update frames on stack overflow",
@@ -566,7 +574,6 @@ error = rtsTrue;
 
              /* =========== GENERAL ========================== */
              case '?':
-             case 'f':
                error = rtsTrue;
                break;
 
@@ -656,23 +663,37 @@ error = rtsTrue;
                }
                break;
 
+#ifdef RTS_GTK_FRONTPANEL
+             case 'f':
+                 RtsFlags.GcFlags.frontpanel = rtsTrue;
+                 break;
+#endif
+
              case 'S':
-               RtsFlags.GcFlags.giveStats ++;
+                 RtsFlags.GcFlags.giveStats = VERBOSE_GC_STATS;
+                 goto stats;
 
              case 's':
-               RtsFlags.GcFlags.giveStats ++;
+                 RtsFlags.GcFlags.giveStats = SUMMARY_GC_STATS;
+                 goto stats;
+
+             case 't':
+                 RtsFlags.GcFlags.giveStats = ONELINE_GC_STATS;
+                 goto stats;
+
+           stats:
 #ifdef PAR
-               /* Opening all those files would almost certainly fail... */
-               RtsFlags.ParFlags.ParStats.Full = rtsTrue;
-               RtsFlags.GcFlags.statsFile = stderr; /* temporary; ToDo: rm */
+                 /* Opening all those files would almost certainly fail... */
+                 RtsFlags.ParFlags.ParStats.Full = rtsTrue;
+                 RtsFlags.GcFlags.statsFile = stderr; /* temporary; ToDo: rm */
 #else
-               RtsFlags.GcFlags.statsFile
-                 = open_stats_file(arg, *argc, argv,
-                       *rts_argc, rts_argv, STAT_FILENAME_FMT);
-
-               if (RtsFlags.GcFlags.statsFile == NULL) error = rtsTrue;
+                 RtsFlags.GcFlags.statsFile
+                     = open_stats_file(arg, *argc, argv,
+                                       *rts_argc, rts_argv, STAT_FILENAME_FMT);
+                 
+                 if (RtsFlags.GcFlags.statsFile == NULL) error = rtsTrue;
 #endif
-               break;
+                 break;
 
              case 'Z':
                RtsFlags.GcFlags.squeezeUpdFrames = rtsFalse;