/* -----------------------------------------------------------------------------
- * $Id: Stats.c,v 1.28 2001/07/02 18:05:10 rrt Exp $
+ * $Id: Stats.c,v 1.31 2001/07/23 17:23:20 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
/* elapsedtime() -- The current elapsed time in seconds */
#if defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
-#define NS_PER_SEC 10000000LL
-/* Convert FILETIMEs into secs since the Epoch (Jan1-1970) */
+#define HNS_PER_SEC 10000000LL /* FILETIMES are in units of 100ns */
+/* Convert FILETIMEs into secs */
#define FT2longlong(ll,ft) \
(ll)=(ft).dwHighDateTime; \
(ll) <<= 32; \
(ll) |= (ft).dwLowDateTime; \
- (ll) /= (unsigned long long) (NS_PER_SEC / CLOCKS_PER_SEC)
+ (ll) /= (unsigned long long) (HNS_PER_SEC / CLOCKS_PER_SEC)
#endif
#if defined(mingw32_TARGET_OS) || defined(cygwin32_TARGET_OS)
if (!GetProcessTimes (GetCurrentProcess(), &creationTime,
&exitTime, &kernelTime, &userTime)) {
/* Probably on a Win95 box..*/
+ CurrentElapsedTime = 0;
+ CurrentUserTime = 0;
return;
}
getTimes(void)
{
-# if !defined(HAVE_TIMES)
+#ifndef HAVE_TIMES
/* We will #ifdef around the fprintf for machines
we *know* are unsupported. (WDP 94/05)
*/
fprintf(stderr, "NOTE: `getTimes' does nothing!\n");
return 0.0;
-# else /* not stumped */
+#else /* not stumped */
struct tms t;
clock_t r = times(&t);
Produce some detailed info on the state of the generational GC.
-------------------------------------------------------------------------- */
void
-stat_describe_gens(void)
+statDescribeGens(void)
{
nat g, s, mut, mut_once, lge, live;
StgMutClosure *m;
bdescr *bd;
step *step;
- fprintf(stderr, " Gen Steps Max Mutable Mut-Once Step Blocks Live Large\n Blocks Closures Closures Objects\n");
+ fprintf(stderr, " Gen Steps Max Mutable Mut-Once Step Blocks Live Large\n Blocks Closures Closures Objects\n");
for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
for (m = generations[g].mut_list, mut = 0; m != END_MUT_LIST;
lge++;
live = 0;
if (RtsFlags.GcFlags.generations == 1) {
- bd = step->to_space;
+ bd = step->to_blocks;
} else {
bd = step->blocks;
}