First import
[xorg_rtime.git] / xorg-server-1.4 / hw / dmx / doc / html / dmxstat_8c.html
blob9a9ecfc65d2d6da2b1214d6a2d3382d475fe8298
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
5 <title>File Index</title>
6 <link href="doxygen.css" rel="stylesheet" type="text/css">
7 </head>
8 <body>
9 <!-- Generated by Doxygen 1.3.4 -->
10 <div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
11 <h1>dmxstat.c File Reference</h1><code>#include "<a class="el" href="dmx_8h-source.html">dmx.h</a>"</code><br>
12 <code>#include "<a class="el" href="dmxstat_8h-source.html">dmxstat.h</a>"</code><br>
13 <code>#include "<a class="el" href="dmxlog_8h-source.html">dmxlog.h</a>"</code><br>
14 <code>#include "Xos.h"</code><br>
15 <table border=0 cellpadding=0 cellspacing=0>
16 <tr><td></td></tr>
17 <tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
18 <tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="struct__DMXStatAvg.html">_DMXStatAvg</a></td></tr>
20 <tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="struct__DMXStatInfo.html">_DMXStatInfo</a></td></tr>
22 <tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
23 <tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="struct__DMXStatAvg.html">_DMXStatAvg</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a0">DMXStatAvg</a></td></tr>
25 <tr><td colspan=2><br><h2>Functions</h2></td></tr>
26 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a6">dmxStatActivate</a> (const char *interval, const char *displays)</td></tr>
28 <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="struct__DMXStatInfo.html">DMXStatInfo</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a7">dmxStatAlloc</a> (void)</td></tr>
30 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a8">dmxStatFree</a> (<a class="el" href="struct__DMXStatInfo.html">DMXStatInfo</a> *pt)</td></tr>
32 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a10">dmxStatSync</a> (<a class="el" href="struct__DMXScreenInfo.html">DMXScreenInfo</a> *dmxScreen, struct timeval *stop, struct timeval *start, unsigned long pending)</td></tr>
34 <tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a12">dmxStatInit</a> (void)</td></tr>
36 <tr><td colspan=2><br><h2>Variables</h2></td></tr>
37 <tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="dmxstat_8c.html#a1">dmxStatInterval</a></td></tr>
39 </table>
40 <hr><a name="_details"></a><h2>Detailed Description</h2>
41 The DMX server code is written to call <a class="el" href="dmxsync_8c.html#a9">dmxSync()</a> whenever an XSync() might be necessary. However, since XSync() requires a two way communication with the other X server, eliminating unnecessary XSync() calls is a key performance optimization. Support for this optimization is provided in #dmxsync.c. This file provides routines that evaluate this optimization by counting the number of XSync() calls and monitoring their latency. This functionality can be turned on using the -stat command-line parameter.<hr><h2>Typedef Documentation</h2>
42 <a class="anchor" name="a0" doxytag="dmxstat.c::DMXStatAvg" ></a><p>
43 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
44 <tr>
45 <td class="mdRow">
46 <table cellpadding="0" cellspacing="0" border="0">
47 <tr>
48 <td class="md" nowrap valign="top"> typedef struct <a class="el" href="struct__DMXStatAvg.html">_DMXStatAvg</a> <a class="el" href="struct__DMXStatAvg.html">DMXStatAvg</a>
49 </table>
50 </td>
51 </tr>
52 </table>
53 <table cellspacing=5 cellpadding=0 border=0>
54 <tr>
55 <td>
56 &nbsp;
57 </td>
58 <td>
60 <p>
61 Used to compute a running average of value. </td>
62 </tr>
63 </table>
64 <hr><h2>Function Documentation</h2>
65 <a class="anchor" name="a6" doxytag="dmxstat.c::dmxStatActivate" ></a><p>
66 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
67 <tr>
68 <td class="mdRow">
69 <table cellpadding="0" cellspacing="0" border="0">
70 <tr>
71 <td class="md" nowrap valign="top"> void dmxStatActivate </td>
72 <td class="md" valign="top">(&nbsp;</td>
73 <td class="md" nowrap valign="top">const char *&nbsp;</td>
74 <td class="mdname" nowrap> <em>interval</em>, </td>
75 </tr>
76 <tr>
77 <td></td>
78 <td></td>
79 <td class="md" nowrap>const char *&nbsp;</td>
80 <td class="mdname" nowrap> <em>displays</em></td>
81 </tr>
82 <tr>
83 <td></td>
84 <td class="md">)&nbsp;</td>
85 <td class="md" colspan="2"></td>
86 </tr>
88 </table>
89 </td>
90 </tr>
91 </table>
92 <table cellspacing=5 cellpadding=0 border=0>
93 <tr>
94 <td>
95 &nbsp;
96 </td>
97 <td>
99 <p>
100 Turn on XSync statistic gathering and printing. Print every <em>interval</em> seconds, with lines for the first <em>displays</em>. If <em>interval</em> is NULL, 1 will be used. If <em>displays</em> is NULL, 0 will be used (meaning a line for every display will be printed). Note that this function takes string arguments because it will usually be called from <a class="el" href="dmxinit_8c.html#a40">ddxProcessArgument</a> in #dmxinit.c. </td>
101 </tr>
102 </table>
103 <a class="anchor" name="a7" doxytag="dmxstat.c::dmxStatAlloc" ></a><p>
104 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
105 <tr>
106 <td class="mdRow">
107 <table cellpadding="0" cellspacing="0" border="0">
108 <tr>
109 <td class="md" nowrap valign="top"> <a class="el" href="struct__DMXStatInfo.html">DMXStatInfo</a>* dmxStatAlloc </td>
110 <td class="md" valign="top">(&nbsp;</td>
111 <td class="md" nowrap valign="top">void&nbsp;</td>
112 <td class="mdname1" valign="top" nowrap> </td>
113 <td class="md" valign="top">&nbsp;)&nbsp;</td>
114 <td class="md" nowrap></td>
115 </tr>
117 </table>
118 </td>
119 </tr>
120 </table>
121 <table cellspacing=5 cellpadding=0 border=0>
122 <tr>
123 <td>
124 &nbsp;
125 </td>
126 <td>
129 Allocate a <em>DMXStatInfo</em> structure. </td>
130 </tr>
131 </table>
132 <a class="anchor" name="a8" doxytag="dmxstat.c::dmxStatFree" ></a><p>
133 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
134 <tr>
135 <td class="mdRow">
136 <table cellpadding="0" cellspacing="0" border="0">
137 <tr>
138 <td class="md" nowrap valign="top"> void dmxStatFree </td>
139 <td class="md" valign="top">(&nbsp;</td>
140 <td class="md" nowrap valign="top"><a class="el" href="struct__DMXStatInfo.html">DMXStatInfo</a> *&nbsp;</td>
141 <td class="mdname1" valign="top" nowrap> <em>pt</em> </td>
142 <td class="md" valign="top">&nbsp;)&nbsp;</td>
143 <td class="md" nowrap></td>
144 </tr>
146 </table>
147 </td>
148 </tr>
149 </table>
150 <table cellspacing=5 cellpadding=0 border=0>
151 <tr>
152 <td>
153 &nbsp;
154 </td>
155 <td>
158 Free the memory used by a <em>DMXStatInfo</em> structure. </td>
159 </tr>
160 </table>
161 <a class="anchor" name="a12" doxytag="dmxstat.c::dmxStatInit" ></a><p>
162 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
163 <tr>
164 <td class="mdRow">
165 <table cellpadding="0" cellspacing="0" border="0">
166 <tr>
167 <td class="md" nowrap valign="top"> void dmxStatInit </td>
168 <td class="md" valign="top">(&nbsp;</td>
169 <td class="md" nowrap valign="top">void&nbsp;</td>
170 <td class="mdname1" valign="top" nowrap> </td>
171 <td class="md" valign="top">&nbsp;)&nbsp;</td>
172 <td class="md" nowrap></td>
173 </tr>
175 </table>
176 </td>
177 </tr>
178 </table>
179 <table cellspacing=5 cellpadding=0 border=0>
180 <tr>
181 <td>
182 &nbsp;
183 </td>
184 <td>
187 Try to initialize the statistic gathering and printing routines. Initialization only takes place if <a class="el" href="dmxstat_8h.html#a6">dmxStatActivate</a> has already been called. We don't need the same generation protection that we used in dmxSyncInit because our timer is always on a queue -- hence, server generation will always free it. </td>
188 </tr>
189 </table>
190 <a class="anchor" name="a10" doxytag="dmxstat.c::dmxStatSync" ></a><p>
191 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
192 <tr>
193 <td class="mdRow">
194 <table cellpadding="0" cellspacing="0" border="0">
195 <tr>
196 <td class="md" nowrap valign="top"> void dmxStatSync </td>
197 <td class="md" valign="top">(&nbsp;</td>
198 <td class="md" nowrap valign="top"><a class="el" href="struct__DMXScreenInfo.html">DMXScreenInfo</a> *&nbsp;</td>
199 <td class="mdname" nowrap> <em>dmxScreen</em>, </td>
200 </tr>
201 <tr>
202 <td></td>
203 <td></td>
204 <td class="md" nowrap>struct timeval *&nbsp;</td>
205 <td class="mdname" nowrap> <em>stop</em>, </td>
206 </tr>
207 <tr>
208 <td></td>
209 <td></td>
210 <td class="md" nowrap>struct timeval *&nbsp;</td>
211 <td class="mdname" nowrap> <em>start</em>, </td>
212 </tr>
213 <tr>
214 <td></td>
215 <td></td>
216 <td class="md" nowrap>unsigned long&nbsp;</td>
217 <td class="mdname" nowrap> <em>pending</em></td>
218 </tr>
219 <tr>
220 <td></td>
221 <td class="md">)&nbsp;</td>
222 <td class="md" colspan="2"></td>
223 </tr>
225 </table>
226 </td>
227 </tr>
228 </table>
229 <table cellspacing=5 cellpadding=0 border=0>
230 <tr>
231 <td>
232 &nbsp;
233 </td>
234 <td>
237 Note that a XSync() was just done on <em>dmxScreen</em> with the <em>start</em> and <em>stop</em> times (from gettimeofday()) and the number of pending-but-not-yet-processed XSync requests. This routine is called from #dmxDoSync in #dmxsync.c </td>
238 </tr>
239 </table>
240 <hr><h2>Variable Documentation</h2>
241 <a class="anchor" name="a1" doxytag="dmxstat.c::dmxStatInterval" ></a><p>
242 <table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
243 <tr>
244 <td class="mdRow">
245 <table cellpadding="0" cellspacing="0" border="0">
246 <tr>
247 <td class="md" nowrap valign="top"> int <a class="el" href="dmxstat_8h.html#a5">dmxStatInterval</a>
248 </table>
249 </td>
250 </tr>
251 </table>
252 <table cellspacing=5 cellpadding=0 border=0>
253 <tr>
254 <td>
255 &nbsp;
256 </td>
257 <td>
260 Only for <a class="el" href="dmxstat_8c.html">dmxstat.c</a> and <a class="el" href="dmxsync_8c.html">dmxsync.c</a> </td>
261 </tr>
262 </table>
263 <hr>
264 <address>
265 <small>
266 Generated June 29, 2004 for <a
267 href="http://dmx.sourceforge.net">Distributed Multihead X</a> by
268 <a href="http://www.doxygen.org/index.html">doxygen</a>
269 1.3.4.
270 </small>
271 </addres>
272 </hr>
273 </body>
274 </html>