[m-rev.] diff: MMC_GPROF

Zoltan Somogyi zs at cs.mu.OZ.AU
Thu May 20 14:26:05 AEST 2004

	Add a mechanism (the environment variable MMC_GPROF) that allows
	the user to request that the executable being built should be
	prepared for graph profiling with gprof. This is of course most
	useful if the runtime system and standard library being linked in
	from the workspace have also been compiled with graph profiling


cvs server: Diffing .
Index: lmc.in
RCS file: /home/mercury1/repository/mercury/tools/lmc.in,v
retrieving revision 1.3
diff -u -b -r1.3 lmc.in
--- lmc.in	8 Jan 2004 05:04:07 -0000	1.3
+++ lmc.in	20 May 2004 04:03:24 -0000
@@ -37,6 +37,10 @@
 # operations by setting the environment variable MMC_TABLE_DEBUG to the same
 # string.
+# You can get the C compiler to enable graph profiling on the generated code
+# by setting the environment variable MMC_GPROF to the string "true".
+# string.
 # You can ask for additional C flags to compile with by setting the environment
 # variable MMC_ADDED_CFLAGS to those flags. Setting up this environment
 # variable one can be more convenient than repeatedly supplying
@@ -77,6 +81,8 @@
 INIT_FLAGS="--trace-init-file $WORKSPACE/browser/mer_browser.init --init-file $WORKSPACE/library/mer_std.init --init-file $WORKSPACE/runtime/mer_rt.init"
 if test "$MMC_CDEBUG" != ""
@@ -94,6 +100,12 @@
+if test "$MMC_GPROF" != ""
+	CDEBUG_FLAGS="$CDEBUG_FLAGS --target-debug --cflags -pg --cflags --no-omit-frame-pointer"
+	LINK_FLAGS="--ld-flags -pg"
 if test "$MMC_ADDED_CFLAGS" != ""
@@ -109,4 +121,4 @@
 export PATH
-exec mmc --no-mercury-stdlib-dir --config-file $WORKSPACE/scripts/Mercury.config -I $WORKSPACE/library -I $WORKSPACE/analysis $CDEBUG_FLAGS $C_FLAGS $INIT_FLAGS $LIB_FLAGS "$@"
+exec mmc --no-mercury-stdlib-dir --config-file $WORKSPACE/scripts/Mercury.config -I $WORKSPACE/library -I $WORKSPACE/analysis $CDEBUG_FLAGS $C_FLAGS $INIT_FLAGS $LIB_FLAGS $LINK_FLAGS "$@"
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