Library
Module
Module type
Parameter
Class
Class type
All about exporting profiling results
A callgraph is a tree where each node
is an instance of a Landmark.landmark
representing the entering and exiting of instrumented code in the execution path.
type node = {
id : id;
Unique identifier.
*)kind : kind;
landmark_id : int;
The node is an instance of this landmark.
*)name : string;
location : string;
calls : int;
Number of time this node was entered.
*)time : float;
Time (in cycles) spent between enter and exit.
*)sons : id list;
The list of instances of landmarks that was entered while the node was opened.
*)sys_time : float;
Time (using Sys.time) spent between enter and exit.
*)allocated_bytes : float;
Gc.allocated_bytes between enter and exit.
*)distrib : float array;
For samplers only. The list of collected samples.
*)}
The type exported view of a node.
The type of callgraphs.
Returns the sons of node (sons graph node
is equivalent to List.map (node_of_id graph) node.sons
)
path_dfs f g graph
traverses the graph in the depth-first fashion starting from the root. At each step we call f visited path v
or g path v
where v
is the visited node and path
is the path from the root that led us to that node. The function g
is called when the visited node v
belongs to path
; it indicates a loop (and the traversal does not continue with the sons of g). The function f
is called when v
does not belong to path
. The flag visited
is true when the vertex has already been visited.
A specialization of path_dfs
that does not need to read the visited flag. The returned values of the first function tells whether or not the traversal should continue visiting the children of the current node.
Returns the depth to the root of the node (it is better to partially apply the function, if you need to call multiple times on the same graph).
Returns the oldest ancestor of a node that is not the root (if it exists) or the root if it does not exist.
Returns an arbitrary number between 0.0 and 1.0.
val total_number_of_calls : graph -> int
Computes the sum of all calls field.
aggregate_landmarks g
computes the quotient by the relation "being an instance of the same landmark".
val output : ?threshold:float -> Stdlib.out_channel -> graph -> unit
Pretty printed output a call graph on an out_channel.
val output_json : Stdlib.out_channel -> graph -> unit
Outputs a JSON representation of a call graph on an out_channel.