mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 03:13:40 +00:00
browser/browser_info.m:
Avoid using "output" (and "input", for the sake of symmetry)
as function symbols.
browser/debugger_interface.m:
Avoid using "pred" and "func" as function symbols by putting a prefix
before each function symbol in the affected type.
browser/dl.m:
Avoid using "local" (and "global", again for symbols) as function symbols.
profiler/output_prof_info.m:
Avoid using "output" as a type name and as a function symbol.
browser/browse.m:
browser/collect_lib.m:
browser/declarative_user.m:
browser/interactive_query.m:
profiler/generate_output.m:
profiler/output.m:
Conform to the changes above.
extras/morphine/source/browse.op:
extras/morphine/source/collect.op:
extras/morphine/source/current_arg.op:
extras/morphine/source/current_slots.op:
extras/morphine/source/exec_control.op:
extras/morphine/source/forward_move.op:
extras/morphine/source/interactive_queries.op:
Conform to the renames of the function symbols in debugger_interface.m.
Since this code is in Prolog, I cannot be sure that I changed all the
places that should be changed, but that does not matter much.
Since Morphine was designed to work with the Prolog dialects of 1999,
had its last update in 2002, and we never test it, it is very likely
that it hasn't worked in a long time. We keep it around because
(a) it may interest someone, and (b) it doesn't require significant
maintenance. The fact that it does not run may be regrettable, but
it is not actually regretted by many would-be users, or (even) any at all.
(I actually noticed and fixed a bug while doing the above change:
it was a typo in a function symbol name.)
102 lines
4.4 KiB
Mathematica
102 lines
4.4 KiB
Mathematica
%---------------------------------------------------------------------------%
|
|
% vim: ft=mercury ts=4 sw=4 et
|
|
%---------------------------------------------------------------------------%
|
|
% Copyright (C) 1995-1997, 2004-2006 The University of Melbourne.
|
|
% This file may only be copied under the terms of the GNU General
|
|
% Public License - see the file COPYING in the Mercury distribution.
|
|
%---------------------------------------------------------------------------%
|
|
%
|
|
% File: output_prof_info.m
|
|
% Main author: petdr.
|
|
%
|
|
% Declare the main data structures for the Mercury profiler and their access
|
|
% predicates, the actual types are exported as well. This is because some
|
|
% predicates need to access entire data structure.
|
|
% XXX Should maybe changed at a later date.
|
|
%
|
|
%---------------------------------------------------------------------------%
|
|
%---------------------------------------------------------------------------%
|
|
|
|
:- module output_prof_info.
|
|
|
|
:- interface.
|
|
|
|
:- import_module list.
|
|
:- import_module map.
|
|
|
|
%---------------------------------------------------------------------------%
|
|
|
|
% XXX Needs to be explained more clearly.
|
|
:- type profiler_output
|
|
---> profiler_output(
|
|
% The map that contains all the info which is required
|
|
% to generate the output.
|
|
|
|
map(string, output_prof),
|
|
|
|
% List of label names used to lookup map. list sorted so that
|
|
% it is in the correct order for call.
|
|
list(string),
|
|
|
|
% Same, except flat.
|
|
list(string)
|
|
).
|
|
|
|
:- type output_prof
|
|
---> output_prof(
|
|
string, % predicate name
|
|
int, % cycle number
|
|
float, % %time in current predicate and descendants
|
|
float, % %time in current predicate
|
|
float, % self: time spent in current predicate
|
|
float, % descendants: time spent in current predicate
|
|
% and descendants
|
|
int, % called: number of times predicate is called
|
|
% excluding self recursive calls
|
|
int, % number of times predicate calls itself.
|
|
list(parent), % parents of predicate
|
|
list(child), % children of predicate
|
|
list(parent), % parents and children who are
|
|
list(child) % members of the same cycle.
|
|
)
|
|
; output_cycle_prof(
|
|
string, % predicate name
|
|
int, % cycle number
|
|
float, % %time in current predicate and descendants
|
|
float, % self: time spent in current predicate
|
|
float, % descendants: time spent in current predicate
|
|
% and descendants
|
|
int, % called: number of times predicate is called
|
|
% excluding self recursive calls
|
|
int, % number of times predicate calls itself.
|
|
list(parent), % parents of predicate
|
|
list(child) % children of predicate
|
|
).
|
|
|
|
:- type parent
|
|
---> parent(
|
|
string, % parent name
|
|
int, % cycle number
|
|
float, % the number of seconds of current predicate's
|
|
% self time which is due to calls from this
|
|
% parent.
|
|
float, % same as above for descendants
|
|
int % calls to current predicate
|
|
).
|
|
|
|
:- type child
|
|
---> child(
|
|
string, % child name
|
|
int, % cycle number
|
|
float, % the number of seconds of child's self time
|
|
% which is due to calls from the current
|
|
% predicate.
|
|
float, % same as above for descendants
|
|
int, % number of times child called
|
|
int % total calls of child
|
|
).
|
|
|
|
%---------------------------------------------------------------------------%
|
|
:- end_module output_prof_info.
|
|
%---------------------------------------------------------------------------%
|