[m-rev.] diff: MMC_GPROF

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


ttools/lmc.in:
	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
	enabled.

Zoltan.

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"
 
+LINK_FLAGS=""
+
 if test "$MMC_CDEBUG" != ""
 then
 	CDEBUG_FLAGS="--target-debug"
@@ -94,6 +100,12 @@
 	CDEBUG_FLAGS="$CDEBUG_FLAGS --cflags -DMR_TABLE_DEBUG"
 fi
 
+if test "$MMC_GPROF" != ""
+then
+	CDEBUG_FLAGS="$CDEBUG_FLAGS --target-debug --cflags -pg --cflags --no-omit-frame-pointer"
+	LINK_FLAGS="--ld-flags -pg"
+fi
+
 if test "$MMC_ADDED_CFLAGS" != ""
 then
 	CDEBUG_FLAGS="$CDEBUG_FLAGS --cflags \"$MMC_ADDED_CFLAGS\""
@@ -109,4 +121,4 @@
 
 PATH="$WORKSPACE/scripts:$WORKSPACE/util:$PATH"
 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