OCaml library : Runtime_events

`sig
type runtime_counter =
EV_C_FORCE_MINOR_ALLOC_SMALL
| EV_C_FORCE_MINOR_MAKE_VECT
| EV_C_FORCE_MINOR_SET_MINOR_HEAP_SIZE
| EV_C_FORCE_MINOR_MEMPROF
| EV_C_MINOR_PROMOTED
| EV_C_MINOR_ALLOCATED
| EV_C_REQUEST_MAJOR_ALLOC_SHR
| EV_C_REQUEST_MAJOR_ADJUST_GC_SPEED
| EV_C_REQUEST_MINOR_REALLOC_REF_TABLE
| EV_C_REQUEST_MINOR_REALLOC_EPHE_REF_TABLE
| EV_C_REQUEST_MINOR_REALLOC_CUSTOM_TABLE
| EV_C_MAJOR_HEAP_POOL_WORDS
| EV_C_MAJOR_HEAP_POOL_LIVE_WORDS
| EV_C_MAJOR_HEAP_LARGE_WORDS
| EV_C_MAJOR_HEAP_POOL_FRAG_WORDS
| EV_C_MAJOR_HEAP_POOL_LIVE_BLOCKS
| EV_C_MAJOR_HEAP_LARGE_BLOCKS
| EV_C_MAJOR_HEAP_WORDS
| EV_C_MAJOR_ALLOCATED_WORDS
| EV_C_MAJOR_ALLOCATED_WORK
| EV_C_MAJOR_DEPENDENT_WORK
| EV_C_MAJOR_EXTRA_WORK
| EV_C_MAJOR_WORK_COUNTER
| EV_C_MAJOR_ALLOC_COUNTER
| EV_C_MAJOR_SLICE_TARGET
| EV_C_MAJOR_SLICE_BUDGET
type runtime_phase =
EV_EXPLICIT_GC_SET
| EV_EXPLICIT_GC_STAT
| EV_EXPLICIT_GC_MINOR
| EV_EXPLICIT_GC_MAJOR
| EV_EXPLICIT_GC_FULL_MAJOR
| EV_EXPLICIT_GC_COMPACT
| EV_MAJOR
| EV_MAJOR_SWEEP
| EV_MAJOR_MARK_ROOTS
| EV_MAJOR_MEMPROF_ROOTS
| EV_MAJOR_MARK
| EV_MINOR
| EV_MINOR_LOCAL_ROOTS
| EV_MINOR_MEMPROF_ROOTS
| EV_MINOR_MEMPROF_CLEAN
| EV_MINOR_FINALIZED
| EV_EXPLICIT_GC_MAJOR_SLICE
| EV_FINALISE_UPDATE_FIRST
| EV_FINALISE_UPDATE_LAST
| EV_INTERRUPT_REMOTE
| EV_MAJOR_EPHE_MARK
| EV_MAJOR_EPHE_SWEEP
| EV_MAJOR_FINISH_MARKING
| EV_MAJOR_GC_CYCLE_DOMAINS
| EV_MAJOR_GC_PHASE_CHANGE
| EV_MAJOR_GC_STW
| EV_MAJOR_MARK_OPPORTUNISTIC
| EV_MAJOR_SLICE
| EV_MAJOR_FINISH_CYCLE
| EV_MINOR_CLEAR
| EV_MINOR_FINALIZERS_OLDIFY
| EV_MINOR_GLOBAL_ROOTS
| EV_MINOR_LEAVE_BARRIER
| EV_STW_API_BARRIER
| EV_STW_HANDLER
| EV_STW_LEADER
| EV_MAJOR_FINISH_SWEEPING
| EV_MAJOR_MEMPROF_CLEAN
| EV_MINOR_FINALIZERS_ADMIN
| EV_MINOR_REMEMBERED_SET
| EV_MINOR_REMEMBERED_SET_PROMOTE
| EV_MINOR_LOCAL_ROOTS_PROMOTE
| EV_DOMAIN_CONDITION_WAIT
| EV_DOMAIN_RESIZE_HEAP_RESERVATION
| EV_COMPACT
| EV_COMPACT_EVACUATE
| EV_COMPACT_FORWARD
| EV_COMPACT_RELEASE
| EV_EMPTY_MINOR
type lifecycle =
EV_RING_START
| EV_RING_STOP
| EV_RING_PAUSE
| EV_RING_RESUME
| EV_FORK_PARENT
| EV_FORK_CHILD
| EV_DOMAIN_SPAWN
| EV_DOMAIN_TERMINATE
val lifecycle_name : Runtime_events.lifecycle -> string
val runtime_phase_name : Runtime_events.runtime_phase -> string
val runtime_counter_name : Runtime_events.runtime_counter -> string
type cursor
module Timestamp :
sig
type t
val to_int64 : Runtime_events.Timestamp.t -> int64
val get_current : unit -> Runtime_events.Timestamp.t
end
module Type :
sig
type 'a t
val unit : unit Runtime_events.Type.t
type span = Begin | End
val span : Runtime_events.Type.span Runtime_events.Type.t
val int : int Runtime_events.Type.t
val register :
encode:(bytes -> 'a -> int) ->
decode:(bytes -> int -> 'a) -> 'a Runtime_events.Type.t
end
module User :
sig
type tag = ..
type 'value t
val register :
string ->
Runtime_events.User.tag ->
'value Runtime_events.Type.t -> 'value Runtime_events.User.t
val write : 'value Runtime_events.User.t -> 'value -> unit
val name : 'a Runtime_events.User.t -> string
val tag : 'a Runtime_events.User.t -> Runtime_events.User.tag
end
module Callbacks :
sig
type t
val create :
?runtime_begin:(int ->
Runtime_events.Timestamp.t ->
Runtime_events.runtime_phase -> unit) ->
?runtime_end:(int ->
Runtime_events.Timestamp.t ->
Runtime_events.runtime_phase -> unit) ->
?runtime_counter:(int ->
Runtime_events.Timestamp.t ->
Runtime_events.runtime_counter -> int -> unit) ->
?alloc:(int -> Runtime_events.Timestamp.t -> int array -> unit) ->
?lifecycle:(int ->
Runtime_events.Timestamp.t ->
Runtime_events.lifecycle -> int option -> unit) ->
?lost_events:(int -> int -> unit) ->
unit -> Runtime_events.Callbacks.t
val add_user_event :
'a Runtime_events.Type.t ->
(int ->
Runtime_events.Timestamp.t -> 'a Runtime_events.User.t -> 'a -> unit) ->
Runtime_events.Callbacks.t -> Runtime_events.Callbacks.t
end
val start : unit -> unit
val path : unit -> string option
val pause : unit -> unit
val resume : unit -> unit
val create_cursor : (string * int) option -> Runtime_events.cursor
val free_cursor : Runtime_events.cursor -> unit
val read_poll :
Runtime_events.cursor -> Runtime_events.Callbacks.t -> int option -> int
end`