package mopsa

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Loop_profiler.HookSource

Hook header

***************

Sourceval name : string
Sourceval debug : ('a, Stdlib.Format.formatter, unit, unit) Stdlib.format4 -> 'a

Profiling records

*********************

Sourcetype loop = {
  1. range : Mopsa.range;
  2. body : Mopsa.stmt;
}

A loop is identified by its range and its body. The information of body is necessary to compute the number of iterations

module LoopMap : sig ... end
Sourcetype iterations = int list

For each loop, and for each time we hit the loop, we compute the number of iterations until we exit the loop

Sourceval stats : iterations LoopMap.t Stdlib.ref

Statistics table mapping loops to iterations stats

Sourceval print : Stdlib.Format.formatter -> unit -> unit

Print statistics table

Sourcetype frame = {
  1. loop : loop;
  2. iterations : int;
  3. inside : bool;
}

A frame in the stack of still-executing loops, for tracking the number iterations

Sourceval stack : frame list Stdlib.ref

Stack of still-executing loops

Sourceval is_loop_body : Mopsa.stmt -> bool

Check whether a statement is the body of the top loop

Sourceval on_enter_loop : Mopsa.range -> Mopsa.stmt -> unit

Event raised when we enter a loop

Sourceval on_enter_body : unit -> unit

Event raised when we start a new iteration

Sourceval on_exit_body : unit -> unit

Event raised when we terminate an iteration

Sourceval on_exit_loop : 'a -> Mopsa.stmt -> unit

Event raised when we exit a loop

Events handlers

*******************

Sourceval init : 'a -> unit
Sourceval on_before_exec : 'a -> Mopsa.stmt -> 'b -> 'c -> unit
Sourceval on_after_exec : 'a -> Mopsa.stmt -> 'b -> 'c -> 'd -> unit
Sourceval on_before_eval : 'a -> 'b -> 'c -> 'd -> 'e -> unit
Sourceval on_after_eval : 'a -> 'b -> 'c -> 'd -> 'e -> 'f -> unit
Sourceval on_finish : 'a -> 'b -> unit
OCaml

Innovation. Community. Security.