Page
Library
Module
Module type
Parameter
Class
Class type
Source
LandmarkSourceThe main module
This function is used by the landmark infrastructure to measure the number of cycles inside landmarks.
Landmarks identify portions of code, they are registered with the function register and delimited by enter and exit.
The type of landmarks.
register name registers a new landmark. Note that landmarks are identified by location + name (or by id if provided). If you register a landmark twice the second call returns a physically equal value to the first call (if you provide id the name & location of the second call is ignored).
landmark_of_id id return the landmark currently identify by id.
Begins a landmark block. /!\ Landmark blocks should be well-nested, otherwise a failure will be raised during profiling.
Puts landmark blocks around a function (and close the block and re-raise in case of uncaught exception).
Puts landmark blocks around a function without catching exceptions.
Counters are similar to landmarks except they represent empty pieces of code. Their only primitive is increment which adds a constant to the field calls. Samplers are used to collect floats.
The type of counters.
register_counter name registers a new counter. Should always be called at top-level.
Increments the number of calls attached to the counter.
The type of samplers.
Checks if the profiling is ongoing.
type profile_output = | Silentdisables the automatic output of profiling results when the program ends.
*)| Temporary of string optionwrites the results in a temporary files and prints its path on stderr.
*)| Channel of out_channelwrites in the results in out_channel.
*)Where to output results.
type profile_format = | JSONEasily parsable export format.
*)| Textual of textual_optionConsole friendly output; nodes below the threshold (0.0 <= threshold <= 100.0) are not displayed in the callgraph.
*)The output format for the results.
type profiling_options = {debug : bool;Activates a verbose mode that outputs traces on stderr each time the landmarks primitives are called. Default: false.
*)allocated_bytes : bool;sys_time : bool;recursive : bool;When false, the recursive instances of landmarks (entering a landmark that has already been entered) are ignored (the number of calls is updated but it does not generate a new node in the callgraph).
*)output : profile_output;Specify where to output the results.
*)format : profile_format;Specify the output format.
*)}The profiling options control the behavior of the landmark infrastructure.
The default profiling_options.
Sets the options.
Get the options.
Starts the profiling.
Stops the profiling.
Reset the profiling information gathered by the current process.
Export the profiling information of the current process.
Export the profiling information of the current process; then reset internal state.
Aggregate the profiling information (exported by another process) to the current one. This should is used by the master process to merge exported profiles of workers.
Save the state of the profiler on a stack to be retrieved later by pop_profiling_state ().
See push_profiling_state ().
This a redefinition of Stdlib.raise to allow generated code to work with -no-stdlib.