malloc_test_rpc.xml 6.5 KB

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