/[eiffelstudio]/FreeELKS/trunk/library/kernel/gc_info.e
ViewVC logotype

Contents of /FreeELKS/trunk/library/kernel/gc_info.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 91424 - (show annotations)
Tue Oct 26 18:39:32 2004 UTC (15 years, 4 months ago) by manus_eiffel
File size: 8852 byte(s)
Initial revision

1 indexing
2
3 description: "[
4 Garbage collector statistics.
5 This class may be used as ancestor by classes needing its facilities.
6 Time accounting is relevant only if `enable_time_accounting'
7 (from MEMORY) has been called.
8 ]"
9
10 status: "See notice at end of class"
11 date: "$Date$"
12 revision: "$Revision$"
13
14 class GC_INFO
15
16 inherit
17 MEMORY_STRUCTURE
18 rename
19 make as structure_make
20 export
21 {NONE} make_by_pointer, structure_make, item, shared
22 end
23
24 MEM_CONST
25
26 create
27 make
28
29 feature -- Initialization
30
31 make (memory: INTEGER) is
32 -- Fill in statistics for `memory' type
33 require
34 memory_valid: memory = Incremental_collector or memory = Full_collector
35 do
36 structure_make
37 update (memory)
38 ensure
39 type_set: type = memory
40 end
41
42 update (memory: INTEGER) is
43 -- Fill in statistics for `memory' type
44 require
45 memory_valid: memory = Incremental_collector or memory = Full_collector
46 do
47 gc_stat (item, memory)
48 type := memory
49 ensure
50 type_set: type = memory
51 end
52
53 feature -- Access
54
55 type: INTEGER
56 -- Collector type (Full, Collect),
57 -- for `type' before last call to `update'
58
59 cycle_count: INTEGER is
60 -- Number of collection cycles for `type'
61 -- before last call to `update'
62 do
63 Result := c_count (item)
64 end
65
66 memory_used: INTEGER is
67 -- Total number of bytes used (counting overhead)
68 -- after last cycle for `type' before last
69 -- call to `update'
70 do
71 Result := c_mem_used (item)
72 end
73
74 collected: INTEGER is
75 -- Number of bytes collected by the last cycle,
76 -- for `type' before last call to `update'
77 do
78 Result := c_mem_collect (item)
79 end
80
81 collected_average: INTEGER is
82 -- Average number of bytes collected by a cycle,
83 -- for `type' before last call to `update'
84 do
85 Result := c_mem_avg (item)
86 end
87
88 real_time: INTEGER is
89 -- Real time in centi-seconds used by last cycle
90 -- for `type', before last call to `update';
91 -- this may not be accurate on systems which do not
92 -- provide a sub-second accuracy clock (typically
93 -- provided on BSD).
94 do
95 Result := c_real_time (item)
96 end
97
98 real_time_average: INTEGER is
99 -- Average amount of real time, in centi-seconds,
100 -- spent in collection cycle,
101 -- for `type' before last call to `update'
102 do
103 Result := c_real_avg (item)
104 end
105
106 real_interval_time: INTEGER is
107 -- Real interval time (as opposed to CPU time) between
108 -- two automatically raised cycles, in centi-seconds,
109 -- for `type' before last call to `update'
110 do
111 Result := c_real_itime (item)
112 end
113
114 real_interval_time_average: INTEGER is
115 -- Average real interval time between two automatic
116 -- cycles, in centi-seconds,
117 -- for `type' before last call to `update'
118 do
119 Result := c_real_iavg (item)
120 end
121
122 cpu_time: DOUBLE is
123 -- Amount of CPU time, in seconds, spent in cycle,
124 -- for `type' before last call to `update'
125 do
126 Result := c_cpu_time (item)
127 end
128
129 cpu_time_average: DOUBLE is
130 -- Average amount of CPU time spent in cycle,
131 -- in seconds, for `type' before last call to `update'
132 do
133 Result := c_cpu_avg (item)
134 end
135
136 cpu_interval_time: DOUBLE is
137 -- Amount of CPU time elapsed since between last
138 -- and penultimate cycles for `type' before
139 -- last call to `update'
140 do
141 Result := c_cpu_itime (item)
142 end
143
144 cpu_interval_time_average: DOUBLE is
145 -- Average amount of CPU time between two cycles,
146 -- for `type' before last call to `update'
147 do
148 Result := c_cpu_iavg (item)
149 end
150
151 sys_time: DOUBLE is
152 -- Amount of kernel time, in seconds, spent in cycle,
153 -- for `type' before last call to `update'
154 do
155 Result := c_sys_time (item)
156 end
157
158 sys_time_average: DOUBLE is
159 -- Average amount of kernel time spent in cycle,
160 -- for `type' before last call to `update'
161 do
162 Result := c_sys_avg (item)
163 end
164
165 sys_interval_time: DOUBLE is
166 -- Amount of kernel time elapsed since between
167 -- the last and the penultimate cycle,
168 -- for `type' before last call to `update'
169 do
170 Result := c_sys_itime (item)
171 end
172
173 sys_interval_time_average: DOUBLE is
174 -- Average amount of kernel time between two cycles,
175 -- for `type' before last call to `update'
176 do
177 Result := c_sys_iavg (item)
178 end
179
180 feature {NONE} -- Implementation
181
182 gc_stat (a_ptr: POINTER; mem: INTEGER) is
183 -- Initialize `a_ptr used by GC_INFO to retrieve the
184 -- statistics frozen at the time of this call.
185 external
186 "C use %"eif_memory.h%""
187 end
188
189 structure_size: INTEGER is
190 -- Size of underlying C structure.
191 do
192 Result := c_sizeof_gacstat
193 end
194
195 feature {NONE} -- C externals
196
197 c_sizeof_gacstat: INTEGER is
198 -- Size of struct `gacstat'.
199 external
200 "C macro use %"eif_eiffel.h%""
201 alias
202 "sizeof(struct gacstat)"
203 end
204
205 c_count (a_ptr: POINTER): INTEGER is
206 -- Access `count' data member of `a_ptr' struct.
207 external
208 "C inline use %"eif_eiffel.h%""
209 alias
210 "((struct gacstat *) $a_ptr)->count"
211 end
212
213 c_mem_used (a_ptr: POINTER): INTEGER is
214 -- Access `mem_used' data member of `a_ptr' struct.
215 external
216 "C inline use %"eif_eiffel.h%""
217 alias
218 "((struct gacstat *) $a_ptr)->mem_used"
219 end
220
221 c_mem_collect (a_ptr: POINTER): INTEGER is
222 -- Access `mem_collect' data member of `a_ptr' struct.
223 external
224 "C inline use %"eif_eiffel.h%""
225 alias
226 "((struct gacstat *) $a_ptr)->mem_collect"
227 end
228
229 c_mem_avg (a_ptr: POINTER): INTEGER is
230 -- Access `mem_avg' data member of `a_ptr' struct.
231 external
232 "C inline use %"eif_eiffel.h%""
233 alias
234 "((struct gacstat *) $a_ptr)->mem_avg"
235 end
236
237 c_real_time (a_ptr: POINTER): INTEGER is
238 -- Access `real_time' data member of `a_ptr' struct.
239 external
240 "C inline use %"eif_eiffel.h%""
241 alias
242 "((struct gacstat *) $a_ptr)->real_time"
243 end
244
245 c_real_avg (a_ptr: POINTER): INTEGER is
246 -- Access `real_avg' data member of `a_ptr' struct.
247 external
248 "C inline use %"eif_eiffel.h%""
249 alias
250 "((struct gacstat *) $a_ptr)->real_avg"
251 end
252
253 c_real_itime (a_ptr: POINTER): INTEGER is
254 -- Access `real_itime' data member of `a_ptr' struct.
255 external
256 "C inline use %"eif_eiffel.h%""
257 alias
258 "((struct gacstat *) $a_ptr)->real_itime"
259 end
260
261 c_real_iavg (a_ptr: POINTER): INTEGER is
262 -- Access `real_iavg' data member of `a_ptr' struct.
263 external
264 "C inline use %"eif_eiffel.h%""
265 alias
266 "((struct gacstat *) $a_ptr)->real_iavg"
267 end
268
269 c_cpu_time (a_ptr: POINTER): DOUBLE is
270 -- Access `cpu_time' data member of `a_ptr' struct.
271 external
272 "C inline use %"eif_eiffel.h%""
273 alias
274 "((struct gacstat *) $a_ptr)->cpu_time"
275 end
276
277 c_cpu_avg (a_ptr: POINTER): DOUBLE is
278 -- Access `cpu_avg' data member of `a_ptr' struct.
279 external
280 "C inline use %"eif_eiffel.h%""
281 alias
282 "((struct gacstat *) $a_ptr)->cpu_avg"
283 end
284
285 c_cpu_itime (a_ptr: POINTER): DOUBLE is
286 -- Access `cpu_itime' data member of `a_ptr' struct.
287 external
288 "C inline use %"eif_eiffel.h%""
289 alias
290 "((struct gacstat *) $a_ptr)->cpu_itime"
291 end
292
293 c_cpu_iavg (a_ptr: POINTER): DOUBLE is
294 -- Access `cpu_iavg' data member of `a_ptr' struct.
295 external
296 "C inline use %"eif_eiffel.h%""
297 alias
298 "((struct gacstat *) $a_ptr)->cpu_iavg"
299 end
300
301 c_sys_time (a_ptr: POINTER): DOUBLE is
302 -- Access `sys_time' data member of `a_ptr' struct.
303 external
304 "C inline use %"eif_eiffel.h%""
305 alias
306 "((struct gacstat *) $a_ptr)->sys_time"
307 end
308
309 c_sys_avg (a_ptr: POINTER): DOUBLE is
310 -- Access `sys_avg' data member of `a_ptr' struct.
311 external
312 "C inline use %"eif_eiffel.h%""
313 alias
314 "((struct gacstat *) $a_ptr)->sys_avg"
315 end
316
317 c_sys_itime (a_ptr: POINTER): DOUBLE is
318 -- Access `sys_itime' data member of `a_ptr' struct.
319 external
320 "C inline use %"eif_eiffel.h%""
321 alias
322 "((struct gacstat *) $a_ptr)->sys_itime"
323 end
324
325 c_sys_iavg (a_ptr: POINTER): DOUBLE is
326 -- Access `sys_iavg' data member of `a_ptr' struct.
327 external
328 "C inline use %"eif_eiffel.h%""
329 alias
330 "((struct gacstat *) $a_ptr)->sys_iavg"
331 end
332
333 indexing
334
335 library: "[
336 EiffelBase: Library of reusable components for Eiffel.
337 ]"
338
339 status: "[
340 Copyright 1986-2001 Interactive Software Engineering (ISE).
341 For ISE customers the original versions are an ISE product
342 covered by the ISE Eiffel license and support agreements.
343 ]"
344
345 license: "[
346 EiffelBase may now be used by anyone as FREE SOFTWARE to
347 develop any product, public-domain or commercial, without
348 payment to ISE, under the terms of the ISE Free Eiffel Library
349 License (IFELL) at http://eiffel.com/products/base/license.html.
350 ]"
351
352 source: "[
353 Interactive Software Engineering Inc.
354 ISE Building
355 360 Storke Road, Goleta, CA 93117 USA
356 Telephone 805-685-1006, Fax 805-685-6869
357 Electronic mail <info@eiffel.com>
358 Customer support http://support.eiffel.com
359 ]"
360
361 info: "[
362 For latest info see award-winning pages: http://eiffel.com
363 ]"
364
365 end -- class GC_INFO
366
367
368

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23