blob: a5c7bbd3275622708be38084a668092fe9efa001 [file] [log] [blame]
njn3e986b22004-11-30 10:43:45 +00001<?xml version="1.0"?> <!-- -*- sgml -*- -->
2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<chapter id="lk-manual" xreflabel="Lackey">
6
njn05a89172009-07-29 02:36:21 +00007<title>Lackey: an example tool</title>
sewardj8d9fec52005-11-15 20:56:23 +00008
9<para>To use this tool, you must specify
njn7e5d4ed2009-07-30 02:57:52 +000010<option>--tool=lackey</option> on the Valgrind
sewardj8d9fec52005-11-15 20:56:23 +000011command line.</para>
12
de03e0e7c2005-12-03 23:02:33 +000013
14<sect1 id="lk-manual.overview" xreflabel="Overview">
15<title>Overview</title>
16
njn6fb923b2009-08-05 06:57:45 +000017<para>Lackey is a simple Valgrind tool that does various kinds of basic
18program measurement. It adds quite a lot of simple instrumentation to the
19program's code. It is primarily intended to be of use as an example tool,
20and consequently emphasises clarity of implementation over
21performance.</para>
sewardj5d1c9012007-02-12 08:42:13 +000022
de03e0e7c2005-12-03 23:02:33 +000023</sect1>
24
25
njna3311642009-08-10 01:29:14 +000026<sect1 id="lk-manual.options" xreflabel="Lackey Command-line Options">
27<title>Lackey Command-line Options</title>
de03e0e7c2005-12-03 23:02:33 +000028
njna3311642009-08-10 01:29:14 +000029<para>Lackey-specific command-line options are:</para>
de03e0e7c2005-12-03 23:02:33 +000030
31<!-- start of xi:include in the manpage -->
32<variablelist id="lk.opts.list">
33
sewardj08e31e22007-05-23 21:58:33 +000034 <varlistentry id="opt.basic-counts" xreflabel="--basic-counts">
de03e0e7c2005-12-03 23:02:33 +000035 <term>
sewardj08e31e22007-05-23 21:58:33 +000036 <option><![CDATA[--basic-counts=<no|yes> [default: yes] ]]></option>
de03e0e7c2005-12-03 23:02:33 +000037 </term>
38 <listitem>
njn6fb923b2009-08-05 06:57:45 +000039 <para>When enabled, Lackey prints the following statistics and
40 information about the execution of the client program:</para>
41
42 <orderedlist>
43
44 <listitem>
45 <para>The number of calls to the function specified by the
46 <option>--fnname</option> option (the default is
47 <computeroutput>main</computeroutput>).
48 If the program has had its symbols stripped, the count will always
49 be zero.</para>
50 </listitem>
51
52 <listitem>
53 <para>The number of conditional branches encountered and the
54 number and proportion of those taken.</para>
55 </listitem>
56
57 <listitem>
58 <para>The number of superblocks entered and completed by the
59 program. Note that due to optimisations done by the JIT, this
60 is not at all an accurate value.</para>
61 </listitem>
62
63 <listitem>
64 <para>The number of guest (x86, amd64, ppc, etc.) instructions and IR
65 statements executed. IR is Valgrind's RISC-like intermediate
66 representation via which all instrumentation is done.
67 </para>
68 </listitem>
69
70 <listitem>
71 <para>Ratios between some of these counts.</para>
72 </listitem>
73
74 <listitem>
75 <para>The exit code of the client program.</para>
76 </listitem>
77
78 </orderedlist>
79
de03e0e7c2005-12-03 23:02:33 +000080 </listitem>
81 </varlistentry>
82
83 <varlistentry id="opt.detailed-counts" xreflabel="--detailed-counts">
84 <term>
85 <option><![CDATA[--detailed-counts=<no|yes> [default: no] ]]></option>
86 </term>
87 <listitem>
njn6fb923b2009-08-05 06:57:45 +000088 <para>When enabled, Lackey prints a table containing counts of loads,
89 stores and ALU operations, differentiated by their IR types.
90 The IR types are identified by their IR name ("I1", "I8", ... "I128",
91 "F32", "F64", and "V128").</para>
de03e0e7c2005-12-03 23:02:33 +000092 </listitem>
93 </varlistentry>
94
sewardj5d1c9012007-02-12 08:42:13 +000095 <varlistentry id="opt.trace-mem" xreflabel="--trace-mem">
96 <term>
97 <option><![CDATA[--trace-mem=<no|yes> [default: no] ]]></option>
98 </term>
99 <listitem>
njn6fb923b2009-08-05 06:57:45 +0000100 <para>When enabled, Lackey prints the size and address of almost every
101 memory access made by the program. See the comments at the top of
102 the file <computeroutput>lackey/lk_main.c</computeroutput> for details
103 about the output format, how it works, and inaccuracies in the address
104 trace. Note that this option produces immense amounts of output.</para>
sewardj5d1c9012007-02-12 08:42:13 +0000105 </listitem>
106 </varlistentry>
107
108 <varlistentry id="opt.trace-superblocks" xreflabel="--trace-superblocks">
109 <term>
110 <option><![CDATA[--trace-superblocks=<no|yes> [default: no] ]]></option>
111 </term>
112 <listitem>
njn6fb923b2009-08-05 06:57:45 +0000113 <para>When enabled,
114 Lackey prints out the address of every superblock
115 (a single entry, multiple exit, linear chunk of code) executed by the
116 program. This is primarily of interest to Valgrind developers. See
117 the comments at the top of the file
118 <computeroutput>lackey/lk_main.c</computeroutput> for details about
119 the output format. Note that this option produces large amounts of
120 output.</para>
121 </listitem>
122 </varlistentry>
123
124 <varlistentry id="opt.fnname" xreflabel="--fnname">
125 <term>
126 <option><![CDATA[--fnname=<name> [default: main] ]]></option>
127 </term>
128 <listitem>
129 <para>Changes the function for which calls are counted when
130 <option>--basic-counts=yes</option> is specified.</para>
sewardj5d1c9012007-02-12 08:42:13 +0000131 </listitem>
132 </varlistentry>
133
de03e0e7c2005-12-03 23:02:33 +0000134</variablelist>
135<!-- end of xi:include in the manpage -->
136
137</sect1>
138
njn3e986b22004-11-30 10:43:45 +0000139</chapter>