Library
Module
Module type
Parameter
Class
Class type
Process behavior monitoring library based on strace
Stramon-lib is primarily designed to power Stramon, or to be used in similar fashion of process monitoring.
module Abs_path : sig ... end
Normalized absolute path representation
module Path_trie : sig ... end
module Path_trie_set : sig ... end
module Syscall : sig ... end
Syscall data and handler
module Stats : sig ... end
Basic monitoring statistics
module Monitor_result : sig ... end
Result of a monitoring session
val monitor :
?debug_level:debug_level ->
?stdin:Unix.file_descr ->
?stdout:Unix.file_descr ->
?stderr:Unix.file_descr ->
handlers:'a Syscall.handler list ->
init_ctx:'a ->
string list ->
('a Monitor_result.t, string) result
monitor ~handlers ~init_ctx cmd
spawns a monitoring session of cmd
.
debug_level
determines the debuging information printed to stderr:
`None
: print nothing (default)`Registered
: print data recognized by one of the handlers
stdin
, stdout
, stderr
are passed to Unix.create_process
, default to Unix.stdin
, Unix.stdout
, and Unix.stderr
respectively.
init_ctx
defines the initial "context". It will be provided to the first handler to be invoked.
If any of the handlers raises an exception, then monitoring is interrupted, and exception is captured in the returned monitor result.
Returns Error
if monitor
fails to create process with cmd
wrapped with strace. This normally means the strace program is not available.
module Utils : sig ... end