143 lines
3.4 KiB
HTML
143 lines
3.4 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Spacetime</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Spacetime</H1>
|
|
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Spacetime - Profiling of a program's space behaviour over time.
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Spacetime
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Spacetime</B>
|
|
|
|
<BR> :
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
Profiling of a program's space behaviour over time.
|
|
Currently only supported on x86-64 platforms running 64-bit code.
|
|
<P>
|
|
To use the functions in this module you must:
|
|
<P>
|
|
-configure the compiler with "-spacetime";
|
|
<P>
|
|
-compile to native code.
|
|
Without these conditions being satisfied the functions in this module
|
|
will have no effect.
|
|
<P>
|
|
Instead of manually taking profiling heap snapshots with this module it is
|
|
possible to use an automatic snapshot facility that writes profiling
|
|
information at fixed intervals to a file. To enable this, all that needs to
|
|
be done is to build the relevant program using a compiler configured with
|
|
-spacetime; and set the environment variable OCAML_SPACETIME_INTERVAL to an
|
|
integer number of milliseconds giving the interval between profiling heap
|
|
snapshots. This interval should not be made excessively small relative to
|
|
the running time of the program. A typical interval to start with might be
|
|
1/100 of the running time of the program. The program must exit "normally"
|
|
(i.e. by calling
|
|
<B>exit</B>
|
|
|
|
, with whatever exit code, rather than being
|
|
abnormally terminated by a signal) so that the snapshot file is
|
|
correctly completed.
|
|
<P>
|
|
When using the automatic snapshot mode the profiling output is written
|
|
to a file called "spacetime-<pid>" where <pid> is the process ID of the
|
|
program. (If the program forks and continues executing then multiple
|
|
files may be produced with different pid numbers.) The profiling output
|
|
is by default written to the current working directory when the program
|
|
starts. This may be customised by setting the OCAML_SPACETIME_SNAPSHOT_DIR
|
|
environment variable to the name of the desired directory.
|
|
<P>
|
|
If using automatic snapshots the presence of the
|
|
<B>save_event_for_automatic_snapshots</B>
|
|
|
|
function, below, should be noted.
|
|
<P>
|
|
The functions in this module are thread safe.
|
|
<P>
|
|
For functions to decode the information recorded by the profiler,
|
|
see the Spacetime offline library in otherlibs/.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val enabled </I>
|
|
|
|
:
|
|
<B>bool</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>enabled</B>
|
|
|
|
is
|
|
<B>true</B>
|
|
|
|
if the compiler is configured with spacetime and
|
|
<B>false</B>
|
|
|
|
otherwise
|
|
<P>
|
|
<P>
|
|
<I>module Series : </I>
|
|
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>module Snapshot : </I>
|
|
|
|
<B>sig end</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val save_event_for_automatic_snapshots </I>
|
|
|
|
:
|
|
<B>event_name:string -> unit</B>
|
|
|
|
<P>
|
|
Like
|
|
<B>Spacetime.Series.save_event</B>
|
|
|
|
, but writes to the automatic snapshot file.
|
|
This function is a no-op if OCAML_SPACETIME_INTERVAL was not set.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">Module</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:57 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|