[m-dev.] For review: print trail information in report_stats/0

Warwick Harvey wharvey at cs.monash.edu.au
Tue May 25 16:46:17 AEST 1999


For anyone to review.

I'm not sure about this whole ``list thing'' for dumping the statistics out 
in report_stats/0.  I suppose it was historical, but particularly if memory 
profiling is being done, it seems a bit silly now.  Anyway, I've tried to 
maintain reasonable formatting for different grade option combinations, 
though the no trail and no garbage collection combination might look a 
little odd (the heap usage would be printed on its own at the start of a 
line when it would have fit on the end of the previous one).  This can be 
fixed at the expense of complicating the code, but I doubt it's worth it.

Warwick


Estimated hours taken: 3

library/benchmarking.m:
	Added the printing of information about the trail to
	ML_report_stats() (and hence report_stats/0).
	Also fixed some cosmetic errors (e.g. if the conservative garbage
	collector was not used, the list was terminated twice).

cvs server: Diffing .
Index: benchmarking.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/benchmarking.m,v
retrieving revision 1.22
diff -u -r1.22 benchmarking.m
--- benchmarking.m      1999/04/30 06:21:01     1.22
+++ benchmarking.m      1999/05/25 06:30:16
@@ -155,7 +155,7 @@
        eng = MR_get_engine();
 
        fprintf(stderr, 
-               ""[Time: +%.3fs, %.3fs, D Stack: %.3fk, ND Stack: %.3fk, "",
+               ""[Time: +%.3fs, %.3fs, D Stack: %.3fk, ND Stack: %.3fk,"",
                (time_at_last_stat - time_at_prev_stat) / 1000.0,
                (time_at_last_stat - time_at_start) / 1000.0,
                ((char *) sp - (char *)
@@ -164,13 +164,21 @@
                        eng->context.nondetstack_zone->min) / 1024.0
        );
 
+#ifdef MR_USE_TRAIL
+       fprintf(stderr,
+               "" Trail: %.3fk,"",
+               ((char *) MR_trail_ptr - (char *)
+                       eng->context.trail_zone->min) / 1024.0
+       );
+#endif
+
        /*
        ** Print heap usage information.
        */
 
 #ifdef CONSERVATIVE_GC
        fprintf(stderr, 
-               ""#GCs: %lu,\\n""
+               ""\\n#GCs: %lu, ""
                ""Heap used since last GC: %.3fk, Total used: %.3fk"",
                (unsigned long) GC_gc_no,
                GC_get_bytes_since_gc() / 1024.0,
@@ -178,7 +186,7 @@
        );
 #else
        fprintf(stderr, 
-               ""Heap: %.3fk]\\n"",
+               ""\\nHeap: %.3fk"",
                ((char *) hp - (char *) eng->heap_zone->min) / 1024.0
        );
 #endif


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list