package mopsa

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

Hook header

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

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

Profiling records

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

type 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
type 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

val stats : iterations LoopMap.t Stdlib.ref

Statistics table mapping loops to iterations stats

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

Print statistics table

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

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

val stack : frame list Stdlib.ref

Stack of still-executing loops

val is_loop_body : Mopsa.stmt -> bool

Check whether a statement is the body of the top loop

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

Event raised when we enter a loop

val on_enter_body : unit -> unit

Event raised when we start a new iteration

val on_exit_body : unit -> unit

Event raised when we terminate an iteration

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

Event raised when we exit a loop

Events handlers

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

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

Innovation. Community. Security.