[m-rev.] diff: minor deep_profiler fixes

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Aug 31 12:14:44 AEST 2009


deep_profiler/mdprof_cgi.m:
	Fix a problem. If the server had exited but the user does not know of,
	a click of the restart button used to show an error message about an
	unexpected restart: the newly started server did not expect to be told
	to restart. Since the user asked the *old* server to restart and the
	new server is effectively a restart of the old one, handle such
	requests as normal startup.

deep_profiler/display_report.m:
	It does not make sense to talk about modules sorted by time
	self-and-desc, but it does make sense to talk about procedures
	sorted that way, so do not disable such sorting.

Zoltan.

cvs diff: Diffing .
Index: display_report.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/display_report.m,v
retrieving revision 1.20
diff -u -b -r1.20 display_report.m
--- display_report.m	16 Jul 2009 07:27:17 -0000	1.20
+++ display_report.m	29 Aug 2009 20:20:32 -0000
@@ -671,9 +671,7 @@
         list.filter(active_proc, ProcRowDatas0, ProcRowDatas1)
     ),
 
-    SortPrefs = avoid_sort_self_and_desc(Prefs),
-    sort_proc_active_rows_by_preferences(SortPrefs,
-        ProcRowDatas1, ProcRowDatas),
+    sort_proc_active_rows_by_preferences(Prefs, ProcRowDatas1, ProcRowDatas),
 
     % Build the table of all modules.
     SortByNamePrefs = Prefs ^ pref_criteria := by_name,
Index: mdprof_cgi.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/deep_profiler/mdprof_cgi.m,v
retrieving revision 1.28
diff -u -b -r1.28 mdprof_cgi.m
--- mdprof_cgi.m	3 Oct 2008 07:39:04 -0000	1.28
+++ mdprof_cgi.m	28 Aug 2009 15:11:37 -0000
@@ -287,7 +287,18 @@
 :- pred process_query(cmd::in, string::in, maybe(preferences)::in,
     option_table::in, io::di, io::uo) is cc_multi.
 
-process_query(Cmd, DeepFileName0, MaybePref, Options0, !IO) :-
+process_query(Cmd0, DeepFileName0, MaybePref, Options0, !IO) :-
+    ( Cmd0 = deep_cmd_restart ->
+        % This process got started because there was no server, and this
+        % process will become the new server, so the user just got the freshly
+        % started server they asked for. There is no point in starting it
+        % again. As it is, create_report would throw an exception for
+        % deep_cmd_restart, expecting it to be filtered out by its usual caller
+        % server_loop. To avoid the exception, we have to filter it out too.
+        Cmd = deep_cmd_menu
+    ;
+        Cmd = Cmd0
+    ),
     (
         MaybePref = yes(Pref),
         PrefInd = given_pref(Pref)
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list