[m-rev.] for review: term size profiling

Zoltan Somogyi zs at cs.mu.OZ.AU
Sat May 31 00:32:32 AEST 2003


On 29-May-2003, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 3.
> > runtime/mercury_engine.[ch]:
> > 	Define a new debugging flag whose purpose is to allow an mdb command,
> > 	"flag enabled on", to turn on low level debugging if the
> > 	executable was compiled with the appropriate options.
> (and any changes elsewhere to make existing code use this new flag).

Here is this diff.

Zoltan.

runtime/mercury_engine.[ch]:
	Define a new debugging flag whose purpose is to allow an mdb command,
	"flag enabled on", to turn on low level debugging if the
	executable was compiled with the appropriate options.

runtime/mercury_debug.c:
	When recomputing MR_lld_print_enabled, respect the new debugging flag.

runtime/mercury_wrapper.c:
	Document the new condition for enabling low level debugging
	implemented by the change to mercury_debug.c.

cvs diff: Diffing .
Index: mercury_debug.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_debug.c,v
retrieving revision 1.15
diff -u -b -r1.15 mercury_debug.c
--- mercury_debug.c	2 Apr 2003 23:22:16 -0000	1.15
+++ mercury_debug.c	30 May 2003 07:45:05 -0000
@@ -422,7 +422,8 @@
 
 	/* the bitwise ORs implement logical OR */
 	MR_lld_print_enabled = MR_lld_print_region_enabled
-		| MR_lld_print_name_enabled | MR_lld_print_csd_enabled;
+		| MR_lld_print_name_enabled | MR_lld_print_csd_enabled
+		| MR_lld_debug_enabled;
 }
 
 void 
Index: mercury_engine.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.c,v
retrieving revision 1.43
diff -u -b -r1.43 mercury_engine.c
--- mercury_engine.c	3 May 2003 04:49:38 -0000	1.43
+++ mercury_engine.c	29 May 2003 16:25:57 -0000
@@ -56,6 +56,7 @@
 	{ "ordreg",	MR_ORDINARY_REG_FLAG },
 	{ "anyreg",	MR_ANY_REG_FLAG },
 	{ "printlocn",	MR_PRINT_LOCN_FLAG },
+	{ "enabled",	MR_LLD_DEBUG_ENABLED_FLAG },
 	{ "notnearest",	MR_NOT_NEAREST_FLAG },
 	{ "detail",	MR_DETAILFLAG }
 };
Index: mercury_engine.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_engine.h,v
retrieving revision 1.31
diff -u -b -r1.31 mercury_engine.h
--- mercury_engine.h	3 May 2003 04:49:38 -0000	1.31
+++ mercury_engine.h	29 May 2003 16:25:57 -0000
@@ -61,9 +61,10 @@
 #define	MR_ORDINARY_REG_FLAG	15
 #define	MR_ANY_REG_FLAG 	16
 #define	MR_PRINT_LOCN_FLAG 	17
-#define	MR_NOT_NEAREST_FLAG 	18
-#define	MR_DETAILFLAG		19
-#define	MR_MAXFLAG		20
+#define	MR_LLD_DEBUG_ENABLED_FLAG 	18
+#define	MR_NOT_NEAREST_FLAG 		19
+#define	MR_DETAILFLAG			20
+#define	MR_MAXFLAG			21
 /* MR_DETAILFLAG should be the last real flag */
 
 /*
@@ -118,6 +119,9 @@
 ** MR_printlocndebug controls whether we want to get diagnostics showing how
 ** the runtime system looks up locations recorded in RTTI data structures.
 **
+** MR_lld_debug_enabled turns on the generation of diagnostic output even when
+** they would otherwise be disabled.
+**
 ** MR_not_nearest_flag, if set, tells minimal model tabling to save stack
 ** segments only to the nearest generator, not to the nearest common ancestor
 ** of the consumer being suspended and its generator.
@@ -141,6 +145,7 @@
 #define	MR_ordregdebug		MR_debugflag[MR_ORDINARY_REG_FLAG]
 #define	MR_anyregdebug		MR_debugflag[MR_ANY_REG_FLAG]
 #define	MR_printlocndebug	MR_debugflag[MR_PRINT_LOCN_FLAG]
+#define	MR_lld_debug_enabled	MR_debugflag[MR_LLD_DEBUG_ENABLED_FLAG]
 #define	MR_not_nearest_flag	MR_debugflag[MR_NOT_NEAREST_FLAG]
 #define	MR_detaildebug		MR_debugflag[MR_DETAILFLAG]
 
Index: mercury_wrapper.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_wrapper.c,v
retrieving revision 1.119
diff -u -b -r1.119 mercury_wrapper.c
--- mercury_wrapper.c	10 Apr 2003 05:51:05 -0000	1.119
+++ mercury_wrapper.c	30 May 2003 07:43:54 -0000
@@ -129,13 +129,13 @@
 ** Getting low level debugging messages from *every* call, *every* heap
 ** allocation etc usually results in an avalanche of data that buries the
 ** information you are looking for, and often runs filesystems out of space.
-** Therefore we inhibit these messages unless any one of three conditions
+** Therefore we inhibit these messages unless any one of four conditions
 ** apply. We implement this by making MR_lld_print_enabled, which controls
 ** the printing of these messages, the logical OR of MR_lld_print_name_enabled,
-** MR_lld_print_csd_enabled and MR_lld_print_region_enabled, which are flags
-** implementing the three conditions. (We rely on these flags being 0 or 1
-** (i.e. MR_FALSE or MR_TRUE) so we can implement logical OR as bitwise OR,
-** which is faster.)
+** MR_lld_print_csd_enabled, MR_lld_print_region_enabled and
+** MR_lld_debug_enabled, which are flags implementing the four conditions.
+** (We rely on these flags being 0 or 1 (i.e. MR_FALSE or MR_TRUE) so we can
+** implement logical OR as bitwise OR, which is faster.)
 **
 ** One condition is MR_lld_start_block calls starting with a call to a
 ** predicate whose entry label matches MR_lld_start_name. Another is
@@ -144,7 +144,8 @@
 ** MR_watch_csd_addr. The third is calls whose sequence number is in a range
 ** specified by MR_lld_print_more_min_max, which should point to a string
 ** containing a comma-separated list of integer intervals (the last interval
-** may be open ended).
+** may be open ended). The fourth is calls between debugger commands that
+** enable and disable low level messages.
 **
 ** MR_lld_start_until and MR_lld_csd_until give the end call numbers of the 
 ** blocks printed for the first two conditions. MR_lld_print_{min,max} give the
cvs diff: Diffing GETOPT
cvs diff: Diffing machdeps
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list