[project @ 2001-11-23 10:27:58 by simonmar]
authorsimonmar <unknown>
Fri, 23 Nov 2001 10:27:58 +0000 (10:27 +0000)
committersimonmar <unknown>
Fri, 23 Nov 2001 10:27:58 +0000 (10:27 +0000)
Fix compilation problems with Stats.c in the !DEBUG case.

ghc/rts/Stats.c
ghc/rts/Stats.h

index a82f395..e34492b 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stats.c,v 1.36 2001/11/22 14:25:12 simonmar Exp $
+ * $Id: Stats.c,v 1.37 2001/11/23 10:27:58 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -229,6 +229,7 @@ mut_user_time( void )
     return TICK_TO_DBL(CurrentUserTime - GC_tot_time - RP_tot_time - LDV_tot_time);
 }
 
+#ifdef PROFILING
 /*
   mut_user_time_during_RP() is similar to mut_user_time_during_GC();
   it returns the MUT time during retainer profiling.
@@ -245,6 +246,7 @@ mut_user_time_during_LDV( void )
 {
   return TICK_TO_DBL(LDV_start_time - GC_tot_time - RP_tot_time - LDV_tot_time);
 }
+#endif // PROFILING
 
 static nat
 pageFaults(void)
@@ -497,17 +499,23 @@ stat_endGC(lnat alloc, lnat collect, lnat live, lnat copied, lnat gen)
 /* -----------------------------------------------------------------------------
    Called at the beginning of each Retainer Profiliing
    -------------------------------------------------------------------------- */
-void stat_startRP(void)
+#ifdef PROFILING
+void
+stat_startRP(void)
 {
   getTimes();
   RP_start_time = CurrentUserTime;
   RPe_start_time = CurrentElapsedTime;
 }
+#endif // PROFILING
 
 /* -----------------------------------------------------------------------------
    Called at the end of each Retainer Profiliing
    -------------------------------------------------------------------------- */
-void stat_endRP(
+
+#ifdef PROFILING
+void
+stat_endRP(
   nat retainerGeneration,
 #ifdef DEBUG_RETAINER
   nat maxCStackSize,
@@ -531,26 +539,33 @@ void stat_endRP(
   fprintf(prof_file, "\tCurrent total costs in bytes = %u\n", allCost * sizeof(StgWord));
   fprintf(prof_file, "\tNumber of retainer sets = %u\n\n", numSet);
 }
+#endif // PROFILING
 
 /* -----------------------------------------------------------------------------
    Called at the beginning of each LDV Profiliing
    -------------------------------------------------------------------------- */
-void stat_startLDV(void)
+#ifdef PROFILING
+void
+stat_startLDV(void)
 {
   getTimes();
   LDV_start_time = CurrentUserTime;
   LDVe_start_time = CurrentElapsedTime;
 }
+#endif // PROFILING
 
 /* -----------------------------------------------------------------------------
    Called at the end of each LDV Profiliing
    -------------------------------------------------------------------------- */
-void stat_endLDV(void) 
+#ifdef PROFILING
+void
+stat_endLDV(void) 
 {
   getTimes();
   LDV_tot_time += CurrentUserTime - LDV_start_time;
   LDVe_tot_time += CurrentElapsedTime - LDVe_start_time;
 }
+#endif // PROFILING
 
 /* -----------------------------------------------------------------------------
    stat_workerStop
@@ -737,6 +752,7 @@ stat_exit(int alloc)
 
    Produce some detailed info on the state of the generational GC.
    -------------------------------------------------------------------------- */
+#ifdef DEBUG
 void
 statDescribeGens(void)
 {
@@ -779,6 +795,7 @@ statDescribeGens(void)
   }
   fprintf(stderr,"\n");
 }
+#endif
 
 /* -----------------------------------------------------------------------------
    Stats available via a programmatic interface, so eg. GHCi can time
index 535bef3..061d5fb 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Stats.h,v 1.12 2001/11/22 14:25:12 simonmar Exp $
+ * $Id: Stats.h,v 1.13 2001/11/23 10:27:58 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -14,6 +14,7 @@ extern void      stat_startGC(void);
 extern void      stat_endGC(lnat alloc, lnat collect, lnat live, 
                            lnat copied, lnat gen);
 
+#ifdef PROFILING
 extern void      stat_startRP(void);
 extern void      stat_endRP(nat, 
 #ifdef DEBUG_RETAINER
@@ -23,6 +24,7 @@ extern void      stat_endRP(nat,
 
 extern void      stat_startLDV(void);
 extern void      stat_endLDV(void);
+#endif // PROFILING
 
 extern void      stat_startExit(void);
 extern void      stat_endExit(void);
@@ -33,12 +35,12 @@ extern void      stat_workerStop(void);
 extern void      initStats(void);
 
 extern double    mut_user_time_during_GC(void);
+extern double    mut_user_time(void);
+
 #ifdef PROFILING
-// @retainer profiling
 extern double    mut_user_time_during_RP(void);
 extern double    mut_user_time_during_LDV(void);
-#endif
-extern double    mut_user_time(void);
+#endif // PROFILING
 
 extern void      statDescribeGens( void );
 extern HsInt     getAllocations( void );