[m-dev.] for review: The first bit of deep profiling

Thomas Conway conway at cs.mu.OZ.AU
Mon Sep 13 12:22:42 AEST 1999


Hi

Zoltan, here's the first bit of deep profiling. Can you please review it.
I'm splitting it up into slices to reduce the update/conflict problems.

-- 
 Thomas Conway )O+     Every sword has two edges.
     Mercurian            <conway at cs.mu.oz.au>


Add a new option for deep profiling to the compiler and the scripts.


compiler/options.m:
	Add the new profiling options `profile-deep' and `deep-profiling'.
compiler/handle_options.m:
	Add code to handle the above options.

scripts/init_grade_options.sh-subr:
	Initialize the profile_deep option to false.
scripts/parse_grade_options.sh-subr:
	Add code handle the deep-profiling options.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/handle_options.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/handle_options.m,v
retrieving revision 1.77
diff -u -r1.77 handle_options.m
--- handle_options.m	1999/08/13 01:42:59	1.77
+++ handle_options.m	1999/08/27 00:20:17
@@ -356,6 +356,15 @@
 		[]
 	),
 
+	% Deep profiling requires `procid' stack layouts
+	globals__io_lookup_bool_option(profile_deep, DeepProfiling),
+	(
+		{ DeepProfiling = yes },
+		globals__io_set_option(procid_stack_layout, bool(yes))
+	;
+		{ DeepProfiling = no }
+	),
+
 	% --no-reorder-conj implies --no-deforestation.
 	option_neg_implies(reorder_conj, deforestation, bool(no)),
 
@@ -671,15 +680,23 @@
 
 	% Profiling components
 grade_component_table("prof", prof, [profile_time - bool(yes),
-	profile_calls - bool(yes), profile_memory - bool(no)]).
+	profile_deep - bool(no), profile_calls - bool(yes),
+	profile_memory - bool(no)]).
+grade_component_table("profdeep", prof, [profile_time - bool(yes),
+	profile_deep - bool(yes), profile_calls - bool(no),
+	profile_memory - bool(no)]).
 grade_component_table("proftime", prof, [profile_time - bool(yes),
-	profile_calls - bool(no), profile_memory - bool(no)]).
+	profile_deep - bool(no), profile_calls - bool(no),
+	profile_memory - bool(no)]).
 grade_component_table("profcalls", prof, [profile_time - bool(no),
-	profile_calls - bool(yes), profile_memory - bool(no)]).
+	profile_deep - bool(no), profile_calls - bool(yes),
+	profile_memory - bool(no)]).
 grade_component_table("memprof", prof, [profile_time - bool(no),
-	profile_calls - bool(yes), profile_memory - bool(yes)]).
+	profile_deep - bool(no), profile_calls - bool(yes),
+	profile_memory - bool(yes)]).
 grade_component_table("profall", prof, [profile_time - bool(yes),
-	profile_calls - bool(yes), profile_memory - bool(yes)]).
+	profile_deep - bool(no), profile_calls - bool(yes),
+	profile_memory - bool(yes)]).
 
 	% Debugging/Tracing components
 grade_component_table("debug", trace,
@@ -716,6 +733,7 @@
 grade_start_values(gc - string("none")).
 grade_start_values(parallel - bool(no)).
 grade_start_values(pic_reg - bool(no)).
+grade_start_values(profile_deep - bool(no)).
 grade_start_values(profile_time - bool(no)).
 grade_start_values(profile_calls - bool(no)).
 grade_start_values(profile_memory - bool(no)).
Index: compiler/options.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/options.m,v
retrieving revision 1.267
diff -u -r1.267 options.m
--- options.m	1999/08/13 01:43:07	1.267
+++ options.m	1999/08/27 00:20:27
@@ -133,9 +133,11 @@
 		;	profiling		% profile_time + profile_calls
 		;	time_profiling		% profile_time + profile_calls
 		;	memory_profiling	% profime_mem + profile_calls
+		;	deep_profiling	% profile_time + profile_deep
 		;	profile_calls
 		;	profile_time
 		;	profile_memory
+		;	profile_deep
 		;	debug
 		;	stack_trace
 		;	require_tracing
@@ -494,9 +496,11 @@
 	profiling		-	bool_special,
 	time_profiling		-	special,
 	memory_profiling	-	special,
+	deep_profiling		-	special,
 	profile_calls		-	bool(no),
 	profile_time		-	bool(no),
 	profile_memory		-	bool(no),
+	profile_deep		-	bool(no),
 	debug			-	bool_special,
 	require_tracing		-	bool(no),
 	stack_trace		-	bool(no),
@@ -853,9 +857,11 @@
 long_option("profiling",		profiling).
 long_option("time-profiling",		time_profiling).
 long_option("memory-profiling",		memory_profiling).
+long_option("deep-profiling",		deep_profiling).
 long_option("profile-calls",		profile_calls).
 long_option("profile-time",		profile_time).
 long_option("profile-memory",		profile_memory).
+long_option("profile-deep",		profile_deep).
 long_option("debug",			debug).
 % The following options are not allowed, because they're
 % not very useful and would probably only confuse people.
@@ -1099,6 +1105,9 @@
 	map__set(OptionTable0, profile_time, bool(no), OptionTable1),
 	map__set(OptionTable1, profile_calls, bool(yes), OptionTable2),
         map__set(OptionTable2, profile_memory, bool(yes), OptionTable).
+special_handler(deep_profiling, none, OptionTable0, ok(OptionTable)) :-
+	map__set(OptionTable0, profile_time, bool(no), OptionTable1),
+	map__set(OptionTable1, profile_deep, bool(yes), OptionTable).
 special_handler(debug, bool(Value), OptionTable0, ok(OptionTable)) :-
 	map__set(OptionTable0, stack_trace, bool(Value), OptionTable1),
 	map__set(OptionTable1, require_tracing, bool(Value), OptionTable).
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/exceptions
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing scripts
Index: scripts/init_grade_options.sh-subr
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/init_grade_options.sh-subr,v
retrieving revision 1.7
diff -u -r1.7 init_grade_options.sh-subr
--- init_grade_options.sh-subr	1999/06/01 09:46:17	1.7
+++ init_grade_options.sh-subr	1999/09/13 02:06:29
@@ -20,6 +20,7 @@
 profile_time=false
 profile_calls=false
 profile_memory=false
+profile_deep=false
 use_trail=false
 use_minimal_model=false
 stack_trace=false
Index: scripts/parse_grade_options.sh-subr
===================================================================
RCS file: /home/staff/zs/imp/mercury/scripts/parse_grade_options.sh-subr,v
retrieving revision 1.10
diff -u -r1.10 parse_grade_options.sh-subr
--- parse_grade_options.sh-subr	1999/06/01 09:46:20	1.10
+++ parse_grade_options.sh-subr	1999/09/13 02:08:37
@@ -67,16 +67,25 @@
 		profile_time=true
 		profile_calls=true
 		profile_memory=false
+		profile_deep=false
 		;;
 	--memory-profiling)
 		profile_time=false
 		profile_calls=true
 		profile_memory=true
+		profile_deep=false
 		;;
+	--deep-profiling)
+		profile_time=true
+		profile_calls=false
+		profile_memory=false
+		profile_deep=true
+		;;
 	-p-|--no-profiling)
 		profile_time=false
 		profile_calls=false
 		profile_memory=false
+		profile_deep=false
 		;;
 	--profile-time)
 		profile_time=true ;;
@@ -90,6 +99,10 @@
 		profile_memory=true ;;
 	--no-profile-memory)
 		profile_memory=false ;;
+	--profile-deep)
+		profile_deep=true ;;
+	--no-profile-deep)
+		profile_deep=false ;;
 
 	--use-trail)
 		use_trail=true ;;
@@ -158,26 +171,37 @@
 				profile_time=false
 				profile_calls=true
 				profile_memory=true
+				profile_deep=false
 				;;
 			prof)
 				profile_time=true
 				profile_calls=true
 				profile_memory=false
+				profile_deep=false
 				;;
 			proftime)	
 				profile_time=true
 				profile_calls=false
 				profile_memory=false
+				profile_deep=false
 				;;
 			profcalls)	
 				profile_time=false
 				profile_calls=true
 				profile_memory=false
+				profile_deep=false
 				;;
 			profall)
 				profile_time=true
 				profile_calls=true
 				profile_memory=true
+				profile_deep=false
+				;;
+			profdeep)
+				profile_time=true
+				profile_calls=false
+				profile_memory=false
+				profile_deep=true
 				;;
 			agc)	gc_method=accurate
 				;;
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list