1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
%docentities;
]
>
<section id="malloc_test.rpcs" xmlns:xi="http://www.w3.org/2001/XInclude">
<sectioninfo>
</sectioninfo>
<title>malloc_test RPC Functions</title>
<section id="mt.mem_alloc">
<title> <function>mt.mem_alloc size [unit]</function></title>
<para>
Allocates the specified number of bytes.
<varname>unit</varname> is optional and can be one of:
<itemizedlist>
<listitem><para><emphasis>b</emphasis> - bytes </para></listitem>
<listitem><para><emphasis>k</emphasis> - KB </para></listitem>
<listitem><para><emphasis>m</emphasis> - MB </para></listitem>
<listitem><para><emphasis>g</emphasis> - GB </para></listitem>
</itemizedlist>
</para>
<example>
<title><function>mt.mem_alloc</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_alloc 10 k
</programlisting>
</example>
</section>
<section id="mt.mem_free">
<title> <function>mt.mem_free [size] [unit]</function></title>
<para>
Frees at least <varname>size</varname> bytes from the memory
allocated by other malloc_test functions (e.g. mt.mem_alloc).
</para>
<para>
<varname>size</varname> is optional. If missing, everything will
be freed.
</para>
<para>
<varname>unit</varname> is optional and can be one of:
<itemizedlist>
<listitem><para><emphasis>b</emphasis> - bytes </para></listitem>
<listitem><para><emphasis>k</emphasis> - KB </para></listitem>
<listitem><para><emphasis>m</emphasis> - MB </para></listitem>
<listitem><para><emphasis>g</emphasis> - GB </para></listitem>
</itemizedlist>
</para>
<example>
<title><function>mt.mem_free</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_free 1 m
</programlisting>
</example>
</section>
<section id="mt.mem_used">
<title> <function>mt.mem_used [unit]</function></title>
<para>
Returns/displays how many bytes are allocated. The default
unit is bytes (for all the possible units see above).
</para>
<para>
<varname>unit</varname> is optional and can be one of:
<itemizedlist>
<listitem><para><emphasis>b</emphasis> - bytes </para></listitem>
<listitem><para><emphasis>k</emphasis> - KB </para></listitem>
<listitem><para><emphasis>m</emphasis> - MB </para></listitem>
<listitem><para><emphasis>g</emphasis> - GB </para></listitem>
</itemizedlist>
</para>
<example>
<title><function>mt.mem_used</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_used
9221460
</programlisting>
</example>
</section>
<section id="mt.mem_rnd_alloc">
<title><function>mt.mem_rnd_alloc min max total [unit]</function>
</title>
<para>
Allocates <varname>total_size</varname> memory, in pieces of
random size between
<varname>min</varname> .. <varname>max</varname> (inclusive).
<varname>unit</varname> is optional and represents the unit for
all the given sizes (see above).
</para>
<example>
<title><function>mt.mem_rnd_alloc</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_rnd_alloc 1 64 10240 k
</programlisting>
</example>
</section>
<section id="mt.mem_test_start">
<title>
<function>
mt.mem_test_start min max total min_int max_int total_time
[unit]
</function>
</title>
<para>
Starts a malloc test that will take <varname>total_time</varname>
to execute. Memory allocations will be performed at intervals
randomly chosen between <varname>min_int</varname> and
<varname>max_int</varname> (in ms). Each allocation will have a
randomly chosen size between <varname>min</varname> and
<varname>max</varname> <varname>unit</varname> bytes. After
<varname>total</varname> <varname>unit</varname> bytes are
allocated, everything is released/freed again and the allocations
are restarted. All the times are expressed in milliseconds.
<varname>unit</varname> is optional and represents the unit for
all the given sizes (see above).
</para>
<para>
Several tests can be run in parallel.
</para>
<para>
Returns the test id.
</para>
<example>
<title><function>mt.mem_test_start</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_test_start 15 64 25000 128 1500 3600000 k
1
</programlisting>
</example>
</section>
<section id="mt.mem_test_stop">
<title> <function>mt.mem_test_stop id</function></title>
<para>
Stops the test indentified by <varname>id</varname>.
</para>
<example>
<title><function>mt.mem_test_stop</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_test_stop 1
</programlisting>
</example>
</section>
<section id="mt.mem_test_destroy">
<title> <function>mt.mem_test_destroy id</function></title>
<para>
Destroys the test indentified by <varname>id</varname>
(besides stopping it, it also frees all the data, including the
statistics).
</para>
<example>
<title><function>mt.mem_test_destroy</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_test_destroy 1
</programlisting>
</example>
</section>
<section id="mt.mem_test_destroy_all">
<title> <function>mt.mem_test_destroy_all id</function></title>
<para>
Destroys all the running or stopped tests.
</para>
<example>
<title><function>mt.mem_test_destroy_all</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_test_destroy_all
</programlisting>
</example>
</section>
<section id="mt.mem_test_list">
<title> <function>mt.mem_test_list [id] [unit]</function></title>
<para>
Returns/displays data about the test identified by
<varname>id</varname>, or if no <varname>id</varname> is
specified, it lists all the tests (running or stopped).
</para>
<para>
<varname>unit</varname> is optional. The default is
is bytes (for all the possible units see above).
</para>
<example>
<title><function>mt.mem_test_list</function> usage</title>
<programlisting>
$ &sercmd; mt.mem_test_list
{
ID : 2
run time (s) : 1471
remaining (s): 2128
allocations : 1749
errors : 24
overflows : 2
total alloc : 69614530
min : 15360
max : 65536
total : 25600000
}
{
ID : 1
run time (s) : 3600
remaining (s): 0
allocations : 4268
errors : 640
overflows : 4
total alloc : 144220713
min : 15360
max : 65536
total : 29696000
}
</programlisting>
</example>
</section>
</section>
|