[m-rev.] for review: order procedures by number of redos in mdprof
Julien Fischer
juliensf at cs.mu.OZ.AU
Tue Jul 12 17:38:08 AEST 2005
For review by anyone.
Estimated hours taken: 0.5
Branches: main, release
deep_profiler/html_format.m:
deep_profiler/interface.m:
deep_profiler/top_procs.m:
Add a control that allows procedures to be ordered by the
number of redos they execute.
Julien.
Index: html_format.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/html_format.m,v
retrieving revision 1.8
diff -u -r1.8 html_format.m
--- html_format.m 8 Jul 2005 16:31:05 -0000 1.8
+++ html_format.m 12 Jul 2005 07:21:52 -0000
@@ -866,10 +866,11 @@
:- func cost_kind_to_description(cost_kind) = string.
-cost_kind_to_description(calls) = "number of calls".
-cost_kind_to_description(time) = "time".
+cost_kind_to_description(calls) = "number of calls".
+cost_kind_to_description(redos) = "number of redos".
+cost_kind_to_description(time) = "time".
cost_kind_to_description(allocs) = "memory allocations".
-cost_kind_to_description(words) = "words allocated".
+cost_kind_to_description(words) = "words allocated".
:- func incl_desc_to_description(include_descendants) = string.
@@ -925,13 +926,14 @@
SecondRow0 = "<TR>\n",
( show_port_counts(Fields) = yes ->
Calls = WrapFunc("Calls", by_cost(calls, self, overall)),
+ Redos = WrapFunc("Redos", by_cost(redos, self, overall)),
FirstRow1 = FirstRow0 ++
"<TH COLSPAN=5>Port counts\n",
SecondRow1 = SecondRow0 ++
- string__format("<TH ALIGN=RIGHT>%s\n", [s(Calls)]) ++
+ string.format("<TH ALIGN=RIGHT>%s\n", [s(Calls)]) ++
"<TH ALIGN=RIGHT>Exits\n" ++
"<TH ALIGN=RIGHT>Fails\n" ++
- "<TH ALIGN=RIGHT>Redos\n" ++
+ string.format("<TH ALIGN=RIGHT>%s\n", [s(Redos)]) ++
"<TH ALIGN=RIGHT>Excps\n"
;
FirstRow1 = FirstRow0,
Index: interface.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/interface.m,v
retrieving revision 1.8
diff -u -r1.8 interface.m
--- interface.m 8 Jul 2005 16:31:06 -0000 1.8
+++ interface.m 12 Jul 2005 07:22:37 -0000
@@ -139,6 +139,7 @@
:- type cost_kind
---> calls
+ ; redos
; time
; allocs
; words.
@@ -825,14 +826,16 @@
:- func cost_kind_to_string(cost_kind) = string.
-cost_kind_to_string(calls) = "calls".
-cost_kind_to_string(time) = "time".
+cost_kind_to_string(calls) = "calls".
+cost_kind_to_string(redos) = "redos".
+cost_kind_to_string(time) = "time".
cost_kind_to_string(allocs) = "allocs".
-cost_kind_to_string(words) = "words".
+cost_kind_to_string(words) = "words".
:- pred string_to_cost_kind(string::in, cost_kind::out) is semidet.
string_to_cost_kind("calls", calls).
+string_to_cost_kind("redos", redos).
string_to_cost_kind("time", time).
string_to_cost_kind("allocs", allocs).
string_to_cost_kind("words", words).
Index: top_procs.m
===================================================================
RCS file: /home/mercury1/repository/mercury/deep_profiler/top_procs.m,v
retrieving revision 1.3
diff -u -r1.3 top_procs.m
--- top_procs.m 23 Jun 2005 08:21:29 -0000 1.3
+++ top_procs.m 12 Jul 2005 07:25:38 -0000
@@ -169,6 +169,14 @@
compare_ps_calls_self_overall, filter_ps_calls_self).
find_top_sort_predicate(calls, self_and_desc, per_call, no,
compare_ps_calls_self_overall, filter_ps_calls_self).
+find_top_sort_predicate(redos, self, overall, yes,
+ compare_ps_redos_self_overall, filter_ps_redos_self).
+find_top_sort_predicate(redos, self, per_call, no,
+ compare_ps_redos_self_overall, filter_ps_redos_self).
+find_top_sort_predicate(redos, self_and_desc, overall, no,
+ compare_ps_redos_self_overall, filter_ps_redos_self).
+find_top_sort_predicate(redos, self_and_desc, per_call, no,
+ compare_ps_redos_self_overall, filter_ps_redos_self).
find_top_sort_predicate(time, self, overall, yes,
compare_ps_time_self_overall, filter_ps_time_self).
find_top_sort_predicate(time, self, per_call, yes,
@@ -200,6 +208,8 @@
find_threshold_predicate(calls, self, no, threshold_ps_time_self).
find_threshold_predicate(calls, self_and_desc, no, threshold_ps_time_self).
+find_threshold_predicate(redos, self, no, threshold_ps_time_self).
+find_threshold_predicate(redos, self_and_desc, no, threshold_ps_time_self).
find_threshold_predicate(time, self, yes, threshold_ps_time_self).
find_threshold_predicate(time, self_and_desc, yes, threshold_ps_time_both).
find_threshold_predicate(allocs, self, yes, threshold_ps_allocs_self).
@@ -219,6 +229,16 @@
OwnCalls2 = calls(Own2),
compare(Result, OwnCalls2, OwnCalls1).
+:- func compare_ps_redos_self_overall(deep, int, int) = comparison_result.
+
+compare_ps_redos_self_overall(Deep, PSI1, PSI2) = Result :-
+ PSOwn = Deep ^ ps_own,
+ array__lookup(PSOwn, PSI1, Own1),
+ array__lookup(PSOwn, PSI2, Own2),
+ OwnRedos1 = redos(Own1),
+ OwnRedos2 = redos(Own2),
+ compare(Result, OwnRedos2, OwnRedos1).
+
:- func compare_ps_time_self_overall(deep, int, int) = comparison_result.
compare_ps_time_self_overall(Deep, PSI1, PSI2) = Result :-
@@ -415,6 +435,14 @@
OwnCalls1 = calls(Own1),
OwnCalls1 > 0.
+:- pred filter_ps_redos_self(deep::in, int::in) is semidet.
+
+filter_ps_redos_self(Deep, PSI1) :-
+ PSOwn = Deep ^ ps_own,
+ array__lookup(PSOwn, PSI1, Own1),
+ OwnCalls1 = redos(Own1),
+ OwnCalls1 > 0.
+
:- pred filter_ps_time_self(deep::in, int::in) is semidet.
filter_ps_time_self(Deep, PSI1) :-
@@ -586,6 +614,9 @@
% sorting on "calls per call" is not useful.
CompFunc = compare_line_groups_by_calls
;
+ Measurement = redos,
+ CompFunc = compare_line_groups_by_redos
+ ;
Measurement = time,
InclDesc = self,
Scope = overall,
@@ -696,6 +727,14 @@
Calls1 = calls(Group1 ^ group_own),
Calls2 = calls(Group2 ^ group_own),
compare(Result, Calls2, Calls1).
+
+:- func compare_line_groups_by_redos(line_group(FL, LL), line_group(FL, LL))
+ = comparison_result.
+
+compare_line_groups_by_redos(Group1, Group2) = Result :-
+ Redos1 = redos(Group1 ^ group_own),
+ Redos2 = redos(Group2 ^ group_own),
+ compare(Result, Redos2, Redos1).
:- func compare_line_groups_by_time_self_overall(line_group(FL, LL),
line_group(FL, LL)) = comparison_result.
--------------------------------------------------------------------------
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