[m-rev.] diff: more deep profiler fixes

Julien Fischer juliensf at cs.mu.OZ.AU
Sat Jul 9 02:04:46 AEST 2005


Estimated hours taken: 3.5
Branches: main, release

Fix some problems in the deep profiling tool.

deep_profiler/html_format.m:
	The control to view times was mislabeled as 'Ticks and times'.

	Update the number of columns used for displaying the port counts.
	Since (some) support for exceptions was added there are now five.
	This fixes a problem where the width of separator rows was incorrect.

	Avoid the division by zero that occurs when calculating the time-per-call
	and there have been zero calls.

deep_profiler/interface.m:
	Change the query separator character from '%' to '&'.  The former
	is used for encoding special characters in URLs and our usage of it
	causes problems for some web browsers.  In particular, this is
	necessary to get the deep profiling tool to work with Safari, which
	in turn is necessary for getting the deep profiler to work
	"out-of-the-box" on OS X.

Julien.

Index: html_format.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/html_format.m,v
retrieving revision 1.7
diff -u -r1.7 html_format.m
--- html_format.m	23 Jun 2005 08:21:28 -0000	1.7
+++ html_format.m	8 Jul 2005 16:01:14 -0000
@@ -402,7 +402,7 @@
 	;
 		Time3Fields = Fields ^ time_fields := time,
 		Time3Pref = Pref ^ pref_fields := Time3Fields,
-		Time3Msg = "Ticks and times",
+		Time3Msg = "Times",
 		Time3Toggle = string__format("<A HREF=""%s"">%s</A>\n",
 			[s(deep_cmd_pref_to_url(Time3Pref, Deep, Cmd)),
 			s(Time3Msg)])
@@ -1226,7 +1226,7 @@
 		Port = 0
 	;
 		Fields ^ port_fields = port,
-		Port = 4
+		Port = 5
 	),
 	(
 		Fields ^ time_fields = no_time,
@@ -1574,7 +1574,11 @@
 	% We display Time as seconds, with two digits after the decimal point.
 	% This is the most we can do, given clock granularity.
 	Time = float(Quanta) / float(TicksPerSec),
-	TimePerCall = Time / float(Calls),
+	( Calls \= 0 ->
+		TimePerCall = Time / float(Calls)
+	;
+		TimePerCall = 0.0
+	),
 	TimeStr = format_time(Pref, TimePerCall).

 :- func format_time(preferences, float) = string.
Index: interface.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/interface.m,v
retrieving revision 1.7
diff -u -r1.7 interface.m
--- interface.m	24 Mar 2005 01:10:27 -0000	1.7
+++ interface.m	8 Jul 2005 16:01:14 -0000
@@ -473,7 +473,7 @@
 :- func field_separator_char = char.
 :- func limit_separator_char = char.

-query_separator_char = ('%').
+query_separator_char = ('&').
 cmd_separator_char = ('/').
 pref_separator_char = ('/').
 criteria_separator_char = ('-').

--------------------------------------------------------------------------
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