<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.10">
<title>ShowProf</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css">
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20201002</a>
</div>
</div>
<div id="header">
<h1>ShowProf</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>If an executable is compiled for <a href="Profiling">profiling</a>, then it
accepts a special command-line runtime system argument, <span class="monospaced">show-prof</span>,
that outputs information about the source functions that are profiled.
Normally, this information is used by <span class="monospaced">mlprof</span>.  This page documents
the <span class="monospaced">show-prof</span> output format, and is intended for those working on
the profiler internals.</p></div>
<div class="paragraph"><p>The <span class="monospaced">show-prof</span> output is ASCII, and consists of a sequence of lines.</p></div>
<div class="ulist"><ul>
<li>
<p>
The magic number of the executable.
</p>
</li>
<li>
<p>
The number of source names in the executable.
</p>
</li>
<li>
<p>
A line for each source name giving the name of the function, a tab,
the filename of the file containing the function, a colon, a space,
and the line number that the function starts on in that file.
</p>
</li>
<li>
<p>
The number of (split) source functions.
</p>
</li>
<li>
<p>
A line for each (split) source function, where each line consists of
a source-name index (into the array of source names) and a successors
index (into the array of split-source sequences, defined below).
</p>
</li>
<li>
<p>
The number of split-source sequences.
</p>
</li>
<li>
<p>
A line for each split-source sequence, where each line is a space
separated list of (split) source functions.
</p>
</li>
</ul></div>
<div class="paragraph"><p>The latter two arrays, split sources and split-source sequences,
define a directed graph, which is the call-graph of the program.</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>
