3 |
|
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
4 |
|
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
5 |
|
|
6 |
< |
<refentry id="get_memory_stats"> |
6 |
> |
<refentry id="sg_get_mem_stats"> |
7 |
|
|
8 |
|
<refentryinfo> |
9 |
|
<date>$Date$</date> |
10 |
|
<releaseinfo>$Id$</releaseinfo> |
11 |
|
</refentryinfo> |
12 |
< |
|
12 |
> |
|
13 |
|
<refmeta> |
14 |
< |
<refentrytitle>get_memory_stats</refentrytitle> |
14 |
> |
<refentrytitle>sg_get_mem_stats</refentrytitle> |
15 |
|
<manvolnum>3</manvolnum> |
16 |
|
<refmiscinfo>i-scream</refmiscinfo> |
17 |
|
</refmeta> |
18 |
< |
|
18 |
> |
|
19 |
|
<refnamediv> |
20 |
< |
<refname>get_memory_stats</refname> |
21 |
< |
<refname>get_swap_stats</refname> |
20 |
> |
<refname>sg_get_mem_stats</refname> |
21 |
> |
<refname>sg_get_swap_stats</refname> |
22 |
|
<refpurpose>get VM statistics</refpurpose> |
23 |
|
</refnamediv> |
24 |
< |
|
24 |
> |
|
25 |
|
<refsynopsisdiv> |
26 |
|
<funcsynopsis> |
27 |
|
<funcsynopsisinfo>#include <statgrab.h></funcsynopsisinfo> |
28 |
|
<funcprototype> |
29 |
< |
<funcdef>mem_stat_t *<function>get_memory_stats</function></funcdef> |
29 |
> |
<funcdef>sg_mem_stats *<function>sg_get_mem_stats</function></funcdef> |
30 |
|
<void/> |
31 |
|
</funcprototype> |
32 |
|
<funcprototype> |
33 |
< |
<funcdef>swap_stat_t *<function>get_swap_stats</function></funcdef> |
33 |
> |
<funcdef>sg_swap_stats *<function>sg_get_swap_stats</function></funcdef> |
34 |
|
<void/> |
35 |
|
</funcprototype> |
36 |
|
</funcsynopsis> |
37 |
|
</refsynopsisdiv> |
38 |
< |
|
38 |
> |
|
39 |
|
<refsect1> |
40 |
|
<title>Description</title> |
41 |
|
<para> |
42 |
|
Memory statistics are accessed through the |
43 |
< |
<function>get_memory_stats</function> function. It returns a |
44 |
< |
pointer to a static <structname>mem_stat_t</structname>. |
43 |
> |
<function>sg_get_mem_stats</function> function. It returns a |
44 |
> |
pointer to a static <structname>sg_mem_stats</structname>. |
45 |
|
</para> |
46 |
|
<para> |
47 |
< |
The <function>get_swap_stats</function> returns returns swap |
47 |
> |
The <function>sg_get_swap_stats</function> returns returns swap |
48 |
|
statistics. It returns a pointer to a static |
49 |
< |
<structname>swap_stat_t</structname>. |
49 |
> |
<structname>sg_swap_stats</structname>. |
50 |
|
</para> |
51 |
|
<para> |
52 |
|
On the FreeBSD operating system elevated privileges are required |
55 |
|
problem. |
56 |
|
</para> |
57 |
|
</refsect1> |
58 |
< |
|
58 |
> |
|
59 |
|
<refsect1> |
60 |
|
<title>Return Values</title> |
61 |
|
|
62 |
|
<para> |
63 |
|
The VM system calls can return a pointer to either a |
64 |
< |
<structname>mem_stat_t</structname> or a |
65 |
< |
<structname>swap_stat_t</structname>. |
64 |
> |
<structname>sg_mem_stats</structname> or a |
65 |
> |
<structname>sg_swap_stats</structname>. |
66 |
|
</para> |
67 |
|
|
68 |
|
<programlisting> |
71 |
|
long long free; |
72 |
|
long long used; |
73 |
|
long long cache; |
74 |
< |
}mem_stat_t; |
74 |
> |
}sg_mem_stats; |
75 |
|
</programlisting> |
76 |
|
|
77 |
|
<variablelist> |
122 |
|
long long total; |
123 |
|
long long used; |
124 |
|
long long free; |
125 |
< |
}swap_stat_t; |
125 |
> |
}sg_swap_stats; |
126 |
|
</programlisting> |
127 |
|
|
128 |
|
<variablelist> |
129 |
|
<varlistentry> |
130 |
|
<term> |
131 |
|
<structfield>total</structfield> |
132 |
< |
</term> |
132 |
> |
</term> |
133 |
|
<listitem> |
134 |
< |
<para> |
134 |
> |
<para> |
135 |
|
The total swap space in bytes. |
136 |
|
</para> |
137 |
|
</listitem> |
138 |
|
</varlistentry> |
139 |
|
<varlistentry> |
140 |
< |
<term> |
140 |
> |
<term> |
141 |
|
<structfield>used</structfield> |
142 |
< |
</term> |
142 |
> |
</term> |
143 |
|
<listitem> |
144 |
< |
<para> |
144 |
> |
<para> |
145 |
|
The used swap in bytes. |
146 |
|
</para> |
147 |
|
</listitem> |
148 |
|
</varlistentry> |
149 |
|
<varlistentry> |
150 |
< |
<term> |
150 |
> |
<term> |
151 |
|
<structfield>free</structfield> |
152 |
< |
</term> |
153 |
< |
<listitem> |
154 |
< |
<para> |
152 |
> |
</term> |
153 |
> |
<listitem> |
154 |
> |
<para> |
155 |
|
The free swap in bytes. |
156 |
< |
</para> |
157 |
< |
</listitem> |
156 |
> |
</para> |
157 |
> |
</listitem> |
158 |
|
</varlistentry> |
159 |
|
</variablelist> |
160 |
|
</refsect1> |
170 |
|
|
171 |
|
<refsect1> |
172 |
|
<title>See Also</title> |
173 |
< |
<para>Nothing yet</para> |
173 |
> |
|
174 |
> |
<simplelist type="inline"> |
175 |
> |
<member> |
176 |
> |
<citerefentry> |
177 |
> |
<refentrytitle>statgrab</refentrytitle> |
178 |
> |
<manvolnum>3</manvolnum> |
179 |
> |
</citerefentry> |
180 |
> |
</member> |
181 |
> |
</simplelist> |
182 |
|
</refsect1> |
183 |
< |
|
183 |
> |
|
184 |
|
<refsect1> |
185 |
|
<title>Website</title> |
186 |
< |
|
186 |
> |
|
187 |
|
<simplelist type="vert"> |
188 |
|
<member> |
189 |
< |
<ulink url="http://www.i-scream.org">http://www.i-scream.org</ulink> |
189 |
> |
<ulink url="http://www.i-scream.org/libstatgrab/"> |
190 |
> |
http://www.i-scream.org/libstatgrab/ |
191 |
> |
</ulink> |
192 |
|
</member> |
193 |
|
</simplelist> |
194 |
|
</refsect1> |