[m-rev.] diff: add --trace-prof

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Sep 28 02:01:04 AEST 2005


Estimated hours taken: 0.5
Branches: main

Add a developer-only option '--trace-prof' that causes the deep profiling
service predicates to show up in the execution trace.

compiler/mercury_compile.m:
	If '--trace-prof' is specified and tracing is enabled then
	trace the profiling builtin predicates.

compiler/options.m:
	Add the '--trace-prof' option.

Julien.

Index: compiler/mercury_compile.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mercury_compile.m,v
retrieving revision 1.349
diff -u -r1.349 mercury_compile.m
--- compiler/mercury_compile.m	26 Sep 2005 05:48:08 -0000	1.349
+++ compiler/mercury_compile.m	26 Sep 2005 06:03:16 -0000
@@ -1144,7 +1144,16 @@

         globals__io_get_globals(Globals, !IO),
         find_timestamp_files(ModuleName, Globals, FindTimestampFiles),
-        ( any_mercury_builtin_module(ModuleName) ->
+
+        globals.io_lookup_bool_option(trace_prof, TraceProf, !IO),
+
+        (
+            any_mercury_builtin_module(ModuleName),
+            not (
+                    mercury_profiling_builtin_module(ModuleName),
+                    TraceProf = yes
+            )
+        ->
             % Some predicates in the builtin modules are missing
             % typeinfo arguments, which means that execution
             % tracing will not work on them. Predicates defined
Index: compiler/options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/options.m,v
retrieving revision 1.468
diff -u -r1.468 options.m
--- compiler/options.m	13 Sep 2005 08:25:31 -0000	1.468
+++ compiler/options.m	27 Sep 2005 15:51:07 -0000
@@ -159,6 +159,7 @@
 		;	assume_gmake
 		;	trace
 		;	trace_optimized
+		;	trace_prof
 		;	trace_table_io
 		;	trace_table_io_only_retry
 		;	trace_table_io_states
@@ -903,6 +904,7 @@
 	assume_gmake		-	bool(yes),
 	trace			-	string("default"),
 	trace_optimized		-	bool(no),
+	trace_prof		-	bool(no),
 	trace_table_io		-	bool(no),
 	trace_table_io_only_retry -	bool(no),
 	trace_table_io_states	-	bool(no),
@@ -1612,6 +1614,7 @@
 long_option("trace",			trace).
 long_option("trace-optimised",		trace_optimized).
 long_option("trace-optimized",		trace_optimized).
+long_option("trace-prof",		trace_prof).
 long_option("trace-table-io",		trace_table_io).
 long_option("trace-table-io-only-retry", trace_table_io_only_retry).
 long_option("trace-table-io-states",	trace_table_io_states).
@@ -3021,6 +3024,10 @@
 % 		"\tdirectory, even for .debug and .decldebug grades.",
 		"--trace-optimized",
 		"\tDo not disable optimizations that can change the trace.",
+% "--trace-prof" is not documented because if is only intended for developers
+% of the deep profiler.
+%		"--trace-prof"",
+%		"\tEnable tracing of deep profiling service pedicates.",
 % I/O tabling is deliberately not documented. It is mean to be switched on,
 % with consistent parameters, in debugging grades, and to be consistently
 % switched off in non-debugging grades. Inconsistent use of the options
--------------------------------------------------------------------------
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