[m-rev.] diff: mtc

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Mar 15 12:20:16 AEDT 2005


scripts/mtc:
	Add this new script (Mercury trace count, by analogy with mdb),
	which simply invokes the command represented by the rest of the
	command line after setting up MERCURY_OPTIONS to ask for the trace
	counts to be generated.

scripts/Mmakefile:
	Add the new script to the list of scripts.

scripts/mdb.in:
	Fix a grammar error.

Zoltan.

cvs diff: Diffing .
Index: Mmakefile
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mmakefile,v
retrieving revision 1.34
diff -u -b -r1.34 Mmakefile
--- Mmakefile	28 Jan 2005 07:11:59 -0000	1.34
+++ Mmakefile	12 Mar 2005 07:06:46 -0000
@@ -14,7 +14,7 @@
 
 #-----------------------------------------------------------------------------#
 
-SCRIPTS = mmake mmc mdb c2init mgnuc ml mprof mprof_merge_runs \
+SCRIPTS = mmake mmc mdb mtc c2init mgnuc ml mprof mprof_merge_runs \
 	  mtags vpath_find mercury_update_interface \
 	  mkfifo_using_mknod mercury_cleanup_install canonical_grade \
 	  mercury_config mercury.bat prepare_tmp_dir_fixed_part
Index: mdb.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mdb.in,v
retrieving revision 1.4
diff -u -b -r1.4 mdb.in
--- mdb.in	30 Jan 2002 14:51:10 -0000	1.4
+++ mdb.in	11 Mar 2005 23:09:18 -0000
@@ -181,7 +181,7 @@
 #-----------------------------------------------------------------------------#
 #
 # Set the environment variables used by the Mercury runtime to the
-# the appropriate values to enabled debugging and to redirect mdb I/O,
+# the appropriate values to enable debugging and to redirect mdb I/O,
 # and then finally use $invoke_cmd to invoke the command.
 #
 
Index: mtc
===================================================================
RCS file: mtc
diff -N mtc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mtc	12 Mar 2005 07:07:54 -0000
@@ -0,0 +1,50 @@
+#!/bin/sh
+#-----------------------------------------------------------------------------#
+# Copyright (C) 2005 The University of Melbourne.
+# This file may only be copied under the terms of the GNU General
+# Public License - see the file COPYING in the Mercury distribution.
+#-----------------------------------------------------------------------------#
+#
+# IMPORTANT: the manpage is produced automatically from this help
+# message, so if you change the help message, don't forget to check
+# that the manpage still looks OK.
+Help="\
+Name:	mtc - gathering trace counts from Mercury programs
+Usage:	mtc <executable> [<args>]...
+Description:
+	\`mtc' invokes the specified command \`<executable> <args>...'.
+	If that command is a Mercury program that was compiled with debugging
+	enabled (e.g. using the \`--debug' option), or if that command invokes
+	such a program, then mtc will cause the program to count the
+	number of times each event is executed, and to write out that data
+	to a file with a .mercury_trace_counts prefix when the program exits.
+	Otherwise, mtc will execute the command line as if the mtc prefix
+	weren't there.
+
+Environment variables:
+	MERCURY_OPTIONS.
+"
+
+#-----------------------------------------------------------------------------#
+#
+# process the command line options
+#
+
+case $# in
+	0)	echo "Usage: mtc <executable> [<arg> ...]" 1>&2
+		exit 1 ;;
+esac
+
+#-----------------------------------------------------------------------------#
+#
+# Set the environment variables used by the Mercury runtime to the
+# the appropriate values to enable the gathering of trace counts,
+# and then finally use $invoke_cmd to invoke the command.
+#
+
+enable_trace_count_opt="--trace-count"
+MERCURY_OPTIONS="$MERCURY_OPTIONS $enable_trace_count_opt"
+export MERCURY_OPTIONS
+exec "$@"
+
+#-----------------------------------------------------------------------------#
--------------------------------------------------------------------------
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