Page
Library
Module
Module type
Parameter
Class
Class type
Source
Stramon_libSourceProcess behavior monitoring library based on strace
Stramon-lib is primarily designed to power Stramon, or to be used in similar fashion of process monitoring.
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) resultmonitor ~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 handlersstdin, 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.