rpc.xml 6.6 KB

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