Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / ShowProf
CommitLineData
7f918cf1
CE
1<!DOCTYPE html>\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
5<meta name="generator" content="AsciiDoc 8.6.9">\r
6<title>ShowProf</title>\r
7<link rel="stylesheet" href="./asciidoc.css" type="text/css">\r
8<link rel="stylesheet" href="./pygments.css" type="text/css">\r
9\r
10\r
11<script type="text/javascript" src="./asciidoc.js"></script>\r
12<script type="text/javascript">\r
13/*<![CDATA[*/\r
14asciidoc.install();\r
15/*]]>*/\r
16</script>\r
17<link rel="stylesheet" href="./mlton.css" type="text/css">\r
18</head>\r
19<body class="article">\r
20<div id="banner">\r
21<div id="banner-home">\r
22<a href="./Home">MLton 20180207</a>\r
23</div>\r
24</div>\r
25<div id="header">\r
26<h1>ShowProf</h1>\r
27</div>\r
28<div id="content">\r
29<div id="preamble">\r
30<div class="sectionbody">\r
31<div class="paragraph"><p>If an executable is compiled for <a href="Profiling">profiling</a>, then it\r
32accepts a special command-line runtime system argument, <span class="monospaced">show-prof</span>,\r
33that outputs information about the source functions that are profiled.\r
34Normally, this information is used by <span class="monospaced">mlprof</span>. This page documents\r
35the <span class="monospaced">show-prof</span> output format, and is intended for those working on\r
36the profiler internals.</p></div>\r
37<div class="paragraph"><p>The <span class="monospaced">show-prof</span> output is ASCII, and consists of a sequence of lines.</p></div>\r
38<div class="ulist"><ul>\r
39<li>\r
40<p>\r
41The magic number of the executable.\r
42</p>\r
43</li>\r
44<li>\r
45<p>\r
46The number of source names in the executable.\r
47</p>\r
48</li>\r
49<li>\r
50<p>\r
51A line for each source name giving the name of the function, a tab,\r
52the filename of the file containing the function, a colon, a space,\r
53and the line number that the function starts on in that file.\r
54</p>\r
55</li>\r
56<li>\r
57<p>\r
58The number of (split) source functions.\r
59</p>\r
60</li>\r
61<li>\r
62<p>\r
63A line for each (split) source function, where each line consists of\r
64a source-name index (into the array of source names) and a successors\r
65index (into the array of split-source sequences, defined below).\r
66</p>\r
67</li>\r
68<li>\r
69<p>\r
70The number of split-source sequences.\r
71</p>\r
72</li>\r
73<li>\r
74<p>\r
75A line for each split-source sequence, where each line is a space\r
76separated list of (split) source functions.\r
77</p>\r
78</li>\r
79</ul></div>\r
80<div class="paragraph"><p>The latter two arrays, split sources and split-source sequences,\r
81define a directed graph, which is the call-graph of the program.</p></div>\r
82</div>\r
83</div>\r
84</div>\r
85<div id="footnotes"><hr></div>\r
86<div id="footer">\r
87<div id="footer-text">\r
88</div>\r
89<div id="footer-badges">\r
90</div>\r
91</div>\r
92</body>\r
93</html>\r