* print_time, print_stats: Output reformated.
[cacao.git] / src / vm / statistics.c
1 /* src/vm/statistics.c - global varables for statistics
2
3    Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5    C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6    Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Christian Thalinger
28
29    $Id: statistics.c 3190 2005-09-16 12:05:10Z twisti $
30
31 */
32
33
34 #include <string.h> 
35 #include <sys/time.h>
36 #include <sys/resource.h>
37
38 #include "toolbox/logging.h"
39 #include "vm/global.h"
40 #include "vm/options.h"
41 #include "vm/statistics.h"
42
43
44 /* global variables */
45
46 static s8 loadingtime = 0;              /* accumulated loading time           */
47 static s8 loadingstarttime = 0;
48 static s8 loadingstoptime = 0;
49 static s4 loadingtime_recursion = 0;
50
51 static s8 compilingtime = 0;            /* accumulated compile time           */
52 static s8 compilingstarttime = 0;
53 static s8 compilingstoptime = 0;
54 static s4 compilingtime_recursion = 0;
55
56 s4 memoryusage = 0;
57 s4 maxmemusage = 0;
58 s4 maxdumpsize = 0;
59
60 s4 globalallocateddumpsize = 0;
61 s4 globaluseddumpsize = 0;
62
63 int count_class_infos = 0;              /* variables for measurements         */
64 int count_const_pool_len = 0;
65 int count_classref_len = 0;
66 int count_parsed_desc_len = 0;
67 int count_vftbl_len = 0;
68 int count_all_methods = 0;
69 int count_methods_marked_used = 0;  /* RTA */
70
71 int count_vmcode_len = 0;
72 int count_extable_len = 0;
73 int count_class_loads = 0;
74 int count_class_inits = 0;
75
76 int count_utf_len = 0;                  /* size of utf hash                   */
77 int count_utf_new = 0;                  /* calls of utf_new                   */
78 int count_utf_new_found  = 0;           /* calls of utf_new with fast return  */
79
80 int count_locals_conflicts = 0;         /* register allocator statistics */
81 int count_locals_spilled = 0;
82 int count_locals_register = 0;
83 int count_ss_spilled = 0;
84 int count_ss_register = 0;
85 int count_methods_allocated_by_lsra = 0;
86 int count_mem_move_bb = 0;
87 int count_interface_size = 0;
88 int count_argument_mem_ss = 0;
89 int count_argument_reg_ss = 0;
90 int count_method_in_register = 0;
91 int count_mov_reg_reg = 0;
92 int count_mov_mem_reg = 0;
93 int count_mov_reg_mem = 0;
94 int count_mov_mem_mem = 0;
95
96 int count_jit_calls = 0;
97 int count_methods = 0;
98 int count_spills = 0;
99 int count_spills_read = 0;
100 int count_pcmd_activ = 0;
101 int count_pcmd_drop = 0;
102 int count_pcmd_zero = 0;
103 int count_pcmd_const_store = 0;
104 int count_pcmd_const_alu = 0;
105 int count_pcmd_const_bra = 0;
106 int count_pcmd_load = 0;
107 int count_pcmd_move = 0;
108 int count_load_instruction = 0;
109 int count_pcmd_store = 0;
110 int count_pcmd_store_comb = 0;
111 int count_dup_instruction = 0;
112 int count_pcmd_op = 0;
113 int count_pcmd_mem = 0;
114 int count_pcmd_met = 0;
115 int count_pcmd_bra = 0;
116 int count_pcmd_table = 0;
117 int count_pcmd_return = 0;
118 int count_pcmd_returnx = 0;
119 int count_check_null = 0;
120 int count_check_bound = 0;
121 int count_max_basic_blocks = 0;
122 int count_basic_blocks = 0;
123 int count_javainstr = 0;
124 int count_max_javainstr = 0;
125 int count_javacodesize = 0;
126 int count_javaexcsize = 0;
127 int count_calls = 0;
128 int count_tryblocks = 0;
129 int count_code_len = 0;
130 int count_data_len = 0;
131 int count_cstub_len = 0;
132 int count_nstub_len = 0;
133 int count_max_new_stack = 0;
134 int count_upper_bound_new_stack = 0;
135                                 /* in_  inline statistics */
136 int count_in = 0;
137 int count_in_uniqVirt = 0;
138 int count_in_uniqIntf = 0;
139 int count_in_rejected = 0;
140 int count_in_rejected_mult = 0;
141 int count_in_outsiders = 0;
142 int count_in_uniqueVirt_not_inlined = 0;
143 int count_in_uniqueInterface_not_inlined = 0;
144 int count_in_maxDepth = 0;
145 int count_in_maxMethods = 0;
146
147 u8 count_native_function_calls=0;
148 u8 count_compiled_function_calls=0;
149 u8 count_jni_callXmethod_calls=0;
150 u8 count_jni_calls=0;
151
152 u2 count_in_not   [512];
153 /***
154 int count_no_in[12] = {0,0,0,0, 0,0,0,0, 0,0,0,0};
155 ***/
156
157
158
159 static int count_block_stack_init[11] = {
160         0, 0, 0, 0, 0, 
161         0, 0, 0, 0, 0, 
162         0
163 };
164 int *count_block_stack = count_block_stack_init;
165 static int count_analyse_iterations_init[5] = {
166         0, 0, 0, 0, 0
167 };
168 int *count_analyse_iterations = count_analyse_iterations_init;
169 static int count_method_bb_distribution_init[9] = {
170         0, 0, 0, 0, 0,
171         0, 0, 0, 0
172 };
173 int *count_method_bb_distribution = count_method_bb_distribution_init;
174 static int count_block_size_distribution_init[18] = {
175         0, 0, 0, 0, 0,
176         0, 0, 0, 0, 0,
177         0, 0, 0, 0, 0,
178         0, 0, 0
179 };
180 int *count_block_size_distribution = count_block_size_distribution_init;
181 static int count_store_length_init[21] = {
182         0, 0, 0, 0, 0,
183         0, 0, 0, 0, 0,
184         0, 0, 0, 0, 0,
185         0, 0, 0, 0, 0,
186         0
187 };
188 int *count_store_length = count_store_length_init;
189 static int count_store_depth_init[11] = {
190         0, 0, 0, 0, 0,
191         0, 0, 0, 0, 0,
192         0
193 };
194 int *count_store_depth = count_store_depth_init;
195
196
197 /* instruction scheduler statistics *******************************************/
198
199 s4 count_schedule_basic_blocks = 0;
200 s4 count_schedule_nodes = 0;
201 s4 count_schedule_leaders = 0;
202 s4 count_schedule_max_leaders = 0;
203 s4 count_schedule_critical_path = 0;
204
205
206
207 /* nativeinvokation ***********************************************************
208
209    increments the native invokation count by one
210         
211 *******************************************************************************/
212 void nativeinvokation() {
213         /*do locking here */
214         count_native_function_calls++;
215 }
216
217 /* compiledinvokation *********************************************************
218
219    increments the compiled invokation count by one
220         
221 *******************************************************************************/
222 void compiledinvokation() {
223         /* do locking here*/
224         count_compiled_function_calls++;
225 }
226
227
228 /* jnicallXmethodinvokation ***************************************************
229
230    increments the jni CallXMethod invokation count by one
231         
232 *******************************************************************************/
233 void jnicallXmethodnvokation() {
234         /*do locking here */
235         count_jni_callXmethod_calls++;
236 }
237
238 /* jniinvokation *************************************************************
239
240    increments the jni overall  invokation count by one
241         
242 *******************************************************************************/
243 void jniinvokation() {
244         /*do locking here */
245         count_jni_calls++;
246 }
247
248
249 /* getcputime *********************************** ******************************
250
251    Returns the used CPU time in microseconds
252         
253 *******************************************************************************/
254
255 s8 getcputime(void)
256 {
257         struct rusage ru;
258         int sec, usec;
259
260         getrusage(RUSAGE_SELF, &ru);
261         sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
262         usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
263
264         return sec * 1000000 + usec;
265 }
266
267
268 /* loadingtime_stop ************************************************************
269
270    XXX
271
272 *******************************************************************************/
273
274 void loadingtime_start(void)
275 {
276         loadingtime_recursion++;
277
278         if (loadingtime_recursion == 1)
279                 loadingstarttime = getcputime();
280 }
281
282
283 /* loadingtime_stop ************************************************************
284
285    XXX
286
287 *******************************************************************************/
288
289 void loadingtime_stop(void)
290 {
291         if (loadingtime_recursion == 1) {
292                 loadingstoptime = getcputime();
293                 loadingtime += (loadingstoptime - loadingstarttime);
294         }
295
296         loadingtime_recursion--;
297 }
298
299
300 /* compilingtime_stop **********************************************************
301
302    XXX
303
304 *******************************************************************************/
305
306 void compilingtime_start(void)
307 {
308         compilingtime_recursion++;
309
310         if (compilingtime_recursion == 1)
311                 compilingstarttime = getcputime();
312 }
313
314
315 /* compilingtime_stop **********************************************************
316
317    XXX
318
319 *******************************************************************************/
320
321 void compilingtime_stop(void)
322 {
323         if (compilingtime_recursion == 1) {
324                 compilingstoptime = getcputime();
325                 compilingtime += (compilingstoptime - compilingstarttime);
326         }
327
328         compilingtime_recursion--;
329 }
330
331
332 /* print_times *****************************************************************
333
334    Prints a summary of CPU time usage.
335
336 *******************************************************************************/
337
338 void print_times(void)
339 {
340         s8 totaltime;
341         s8 runtime;
342
343         totaltime = getcputime();
344         runtime = totaltime - loadingtime - compilingtime;
345
346 #if SIZEOF_VOID_P == 8
347         dolog("Time for loading classes: %6ld ms", loadingtime / 1000);
348         dolog("Time for compiling code:  %6ld ms", compilingtime / 1000);
349         dolog("Time for running program: %6ld ms", runtime / 1000);
350         dolog("Total time:               %6ld ms", totaltime / 1000);
351 #else
352         dolog("Time for loading classes: %6lld ms", loadingtime / 1000);
353         dolog("Time for compiling code:  %6lld ms", compilingtime / 1000);
354         dolog("Time for running program: %6lld ms", runtime / 1000);
355         dolog("Total time:               %6lld ms", totaltime / 1000);
356 #endif
357 }
358
359
360 /* print_stats *****************************************************************
361
362    outputs detailed compiler statistics
363
364 *******************************************************************************/
365
366 void print_stats(void)
367 {
368         dolog("Number of JIT compiler calls: %6d", count_jit_calls);
369         dolog("Number of compiled methods:   %6d", count_methods);
370
371         if (opt_rt)
372                 dolog("Number of Methods marked Used: %d", count_methods_marked_used);
373
374         dolog("Number of compiled basic blocks:               %6d",
375                   count_basic_blocks);
376         dolog("Number of max. basic blocks per method:        %6d",
377                   count_max_basic_blocks);
378
379         dolog("Number of compiled JavaVM instructions:        %6d",
380                   count_javainstr);
381         dolog("Number of max. JavaVM instructions per method: %6d",
382                   count_max_javainstr);
383         dolog("Size of compiled JavaVM instructions:          %6d(%d)",
384                   count_javacodesize, count_javacodesize - count_methods * 18);
385
386         dolog("Size of compiled Exception Tables:      %d", count_javaexcsize);
387         dolog("Number of Machine-Instructions: %d", count_code_len >> 2);
388         dolog("Number of Spills (write to memory): %d", count_spills);
389         dolog("Number of Spills (read from memory): %d", count_spills_read);
390         dolog("Number of Activ    Pseudocommands: %6d", count_pcmd_activ);
391         dolog("Number of Drop     Pseudocommands: %6d", count_pcmd_drop);
392         dolog("Number of Const    Pseudocommands: %6d (zero:%5d)",
393                   count_pcmd_load, count_pcmd_zero);
394         dolog("Number of ConstAlu Pseudocommands: %6d (cmp: %5d, store:%5d)",
395                   count_pcmd_const_alu, count_pcmd_const_bra, count_pcmd_const_store);
396         dolog("Number of Move     Pseudocommands: %6d", count_pcmd_move);
397         dolog("Number of Load     Pseudocommands: %6d", count_load_instruction);
398         dolog("Number of Store    Pseudocommands: %6d (combined: %5d)",
399                   count_pcmd_store, count_pcmd_store - count_pcmd_store_comb);
400         dolog("Number of OP       Pseudocommands: %6d", count_pcmd_op);
401         dolog("Number of DUP      Pseudocommands: %6d", count_dup_instruction);
402         dolog("Number of Mem      Pseudocommands: %6d", count_pcmd_mem);
403         dolog("Number of Method   Pseudocommands: %6d", count_pcmd_met);
404         dolog("Number of Branch   Pseudocommands: %6d (rets:%5d, Xrets: %5d)",
405                   count_pcmd_bra, count_pcmd_return, count_pcmd_returnx);
406         dolog("Number of Table    Pseudocommands: %6d", count_pcmd_table);
407         dolog("Number of Useful   Pseudocommands: %6d", count_pcmd_table +
408                   count_pcmd_bra + count_pcmd_load + count_pcmd_mem + count_pcmd_op);
409         dolog("Number of Null Pointer Checks:     %6d", count_check_null);
410         dolog("Number of Array Bound Checks:      %6d", count_check_bound);
411         dolog("Number of Try-Blocks: %d", count_tryblocks);
412         dolog("Maximal count of stack elements:   %d", count_max_new_stack);
413         dolog("Upper bound of max stack elements: %d", count_upper_bound_new_stack);
414         dolog("Distribution of stack sizes at block boundary");
415         dolog("     0     1     2     3     4     5     6     7     8     9  >=10");
416         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
417                   count_block_stack[0], count_block_stack[1], count_block_stack[2],
418                   count_block_stack[3], count_block_stack[4], count_block_stack[5],
419                   count_block_stack[6], count_block_stack[7], count_block_stack[8],
420                   count_block_stack[9], count_block_stack[10]);
421         dolog("Distribution of store stack depth");
422         dolog("     0     1     2     3     4     5     6     7     8     9  >=10");
423         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
424                   count_store_depth[0], count_store_depth[1], count_store_depth[2],
425                   count_store_depth[3], count_store_depth[4], count_store_depth[5],
426                   count_store_depth[6], count_store_depth[7], count_store_depth[8],
427                   count_store_depth[9], count_store_depth[10]);
428         dolog("Distribution of store creator chains first part");
429         dolog("     0     1     2     3     4     5     6     7     8     9");
430         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
431                   count_store_length[0], count_store_length[1], count_store_length[2],
432                   count_store_length[3], count_store_length[4], count_store_length[5],
433                   count_store_length[6], count_store_length[7], count_store_length[8],
434                   count_store_length[9]);
435         dolog("Distribution of store creator chains second part");
436         dolog("    10    11    12    13    14    15    16    17    18    19  >=20");
437         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
438                   count_store_length[10], count_store_length[11],
439                   count_store_length[12], count_store_length[13],
440                   count_store_length[14], count_store_length[15],
441                   count_store_length[16], count_store_length[17],
442                   count_store_length[18], count_store_length[19],
443                   count_store_length[20]);
444         dolog("Distribution of analysis iterations");
445         dolog("     1     2     3     4   >=5");
446         dolog("%6d%6d%6d%6d%6d",
447                   count_analyse_iterations[0], count_analyse_iterations[1],
448                   count_analyse_iterations[2], count_analyse_iterations[3],
449                   count_analyse_iterations[4]);
450         dolog("Distribution of basic blocks per method");
451         dolog("   <=5  <=10  <=15  <=20  <=30  <=40  <=50  <=75   >75");
452         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d",
453                   count_method_bb_distribution[0], count_method_bb_distribution[1],
454                   count_method_bb_distribution[2], count_method_bb_distribution[3],
455                   count_method_bb_distribution[4], count_method_bb_distribution[5],
456                   count_method_bb_distribution[6], count_method_bb_distribution[7],
457                   count_method_bb_distribution[8]);
458         dolog("Distribution of basic block sizes");
459         dolog("     0     1     2     3     4    5    6    7    8    9  <13  <15  <17  <19  <21  <26  <31  >30");
460         dolog("%6d%6d%6d%6d%6d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d%5d",
461                   count_block_size_distribution[0], count_block_size_distribution[1],
462                   count_block_size_distribution[2], count_block_size_distribution[3],
463                   count_block_size_distribution[4], count_block_size_distribution[5],
464                   count_block_size_distribution[6], count_block_size_distribution[7],
465                   count_block_size_distribution[8], count_block_size_distribution[9],
466                   count_block_size_distribution[10], count_block_size_distribution[11],
467                   count_block_size_distribution[12], count_block_size_distribution[13],
468                   count_block_size_distribution[14], count_block_size_distribution[15],
469                   count_block_size_distribution[16], count_block_size_distribution[17]);
470         dolog("Size of Code Area (Kb):  %10.3f", (float) count_code_len / 1024);
471         dolog("Size of data Area (Kb):  %10.3f", (float) count_data_len / 1024);
472         dolog("Size of Class Infos (Kb):%10.3f", (float) count_class_infos / 1024);
473         dolog("Size of Const Pool (Kb): %10.3f",
474                   (float) (count_const_pool_len + count_utf_len) / 1024);
475         dolog("Size of Class refs (Kb): %10.3f", (float) count_classref_len / 1024);
476         dolog("Size of descriptors(Kb): %10.3f",
477                   (float) count_parsed_desc_len / 1024);
478         dolog("Size of Vftbl (Kb):      %10.3f", (float) count_vftbl_len / 1024);
479         dolog("Size of comp stub (Kb):  %10.3f", (float) count_cstub_len / 1024);
480         dolog("Size of native stub (Kb):%10.3f", (float) count_nstub_len / 1024);
481         dolog("Size of Utf (Kb):        %10.3f", (float) count_utf_len / 1024);
482         dolog("Size of VMCode (Kb):     %10.3f(%d)",
483                   (float) count_vmcode_len / 1024,
484                   count_vmcode_len - 18 * count_all_methods);
485         dolog("Size of ExTable (Kb):    %10.3f", (float) count_extable_len / 1024);
486         dolog("Number of class loads:   %d", count_class_loads);
487         dolog("Number of class inits:   %d", count_class_inits);
488         dolog("Number of loaded Methods: %d\n", count_all_methods);
489
490         dolog("Calls of utf_new: %22d", count_utf_new);
491         dolog("Calls of utf_new (element found): %6d\n", count_utf_new_found);
492
493
494         /* LSRA statistics ********************************************************/
495
496         dolog("Moves reg -> reg:     %6d", count_mov_reg_reg);
497         dolog("Moves mem -> reg:     %6d", count_mov_mem_reg);
498         dolog("Moves reg -> mem:     %6d", count_mov_reg_mem);
499         dolog("Moves mem -> mem:     %6d", count_mov_mem_mem);
500
501         dolog("Methods allocated by LSRA:         %6d",
502                   count_methods_allocated_by_lsra);
503         dolog("Conflicts between local Variables: %6d", count_locals_conflicts);
504         dolog("Local Variables held in Memory:    %6d", count_locals_spilled);
505         dolog("Local Variables held in Registers: %6d", count_locals_register);
506         dolog("Stackslots held in Memory:         %6d", count_ss_spilled);
507         dolog("Stackslots held in Registers:      %6d", count_ss_register);
508         dolog("Memory moves at BB Boundaries:     %6d", count_mem_move_bb);
509         dolog("Number of interface slots:         %6d\n", count_interface_size);
510         dolog("Number of Argument stack slots in register:  %6d",
511                   count_argument_reg_ss);
512         dolog("Number of Argument stack slots in memory:    %6d\n",
513                   count_argument_mem_ss);
514         dolog("Number of Methods kept in registers:         %6d\n",
515                   count_method_in_register);
516
517                 
518         /****if (useinlining)  ***/
519          {
520                 u2 i;
521                 char * in_not_reasons[IN_MAX] = {
522                                                 "unqVirt    | ",
523                                                 "unqIntf    | ",
524                                                 "outsider   | ",
525                                                 "maxDepth   | ",
526                                                 "maxcode    | ",
527                                                 "maxlen     | ",
528                                                 "exception  | ",
529                                                 "notUnqVirt | ",
530                                                 "notUnqIntf |"
531                                                 };
532
533                 dolog("Number of Methods Inlined :                              \t%6d",
534                           count_in);
535
536                 if (inlinevirtuals) {
537                         dolog("Number of Unique Virtual Methods inlined:                \t%6d",
538                                   count_in_uniqVirt);
539                         dolog("Number of Unique Implemented Interface Methods inlined:    %6d",
540                                   count_in_uniqIntf);
541                 }
542
543                 dolog("Number of Methods Inlines (total) rejected:              \t%6d",
544                           count_in_rejected);
545                 dolog("Number of Methods Inlined rejected for multiple reasons: \t%6d",
546                           count_in_rejected_mult);
547                 dolog("Number of Methods where Inline max depth hit:            \t%6d",
548                           count_in_maxDepth);
549                 dolog("Number of Methods Inlined rejected for max methods       \t%6d\n",
550                           count_in_maxMethods);
551                 dolog("Number of Methods calls fom Outsider Class not inlined:  \t%6d",
552                           count_in_outsiders);
553
554                 dolog("Number of Unique Virtual Methods not inlined:            \t%6d",
555                           count_in_uniqueVirt_not_inlined);
556                 dolog("Number of Unique Implemented Interface Methods not inlined:%6d\n",
557                           count_in_uniqueInterface_not_inlined);
558
559 #define INLINEDETAILS
560 #ifdef  INLINEDETAILS
561                 dolog("Details about Not Inlined Reasons:");
562
563                 for (i = 0; i < 512; i++) {
564                         if (count_in_not[i] > 0) {
565                                 /* XXX Please reimplement me! I'm ugly and insecure! */
566                                 char logtext2[1024]="\t";
567
568                                 if (inlinevirtuals) {
569                                         if (i & IN_UNIQUEVIRT)
570                                                 strcat(logtext2, in_not_reasons[N_UNIQUEVIRT]);
571
572                                         if (i & IN_UNIQUE_INTERFACE)
573                                                 strcat(logtext2, in_not_reasons[N_UNIQUE_INTERFACE]);
574
575                                         if (i & IN_NOT_UNIQUE_VIRT)
576                                                 strcat(logtext2, in_not_reasons[N_NOT_UNIQUE_VIRT]);
577
578                                         if (i & IN_NOT_UNIQUE_INTERFACE)
579                                                 strcat(logtext2, in_not_reasons[N_NOT_UNIQUE_INTERFACE]);
580                                 }
581
582                                 if (i & IN_OUTSIDERS)
583                                         strcat(logtext2, in_not_reasons[N_OUTSIDERS]);
584
585                                 if (i & IN_MAXDEPTH)
586                                         strcat(logtext2, in_not_reasons[N_MAXDEPTH]);
587
588                                 if (i & IN_MAXCODE)
589                                         strcat(logtext2, in_not_reasons[N_MAXCODE]);
590
591                                 if (i & IN_JCODELENGTH)
592                                         strcat(logtext2, in_not_reasons[N_JCODELENGTH]);
593
594                                 if (i & IN_EXCEPTION)
595                                         strcat(logtext2, in_not_reasons[N_EXCEPTION]);
596
597                                 dolog("  [%X]=%6d    %s", i, count_in_not[i], logtext2);
598                         }
599                 }
600 #endif
601          }
602
603
604          /* instruction scheduler statistics **************************************/
605
606 #if defined(USE_SCHEDULER)
607          dolog("Instruction scheduler statistics:");
608          dolog("Number of basic blocks:       %7d", count_schedule_basic_blocks);
609          dolog("Number of nodes:              %7d", count_schedule_nodes);
610          dolog("Number of leaders nodes:      %7d", count_schedule_leaders);
611          dolog("Number of max. leaders nodes: %7d", count_schedule_max_leaders);
612          dolog("Length of critical path:      %7d\n", count_schedule_critical_path);
613 #endif
614
615
616         /* call statistics ********************************************************/
617
618          dolog("Function call statistics:");
619          dolog("Number of native function invokations:           %ld",
620                    count_native_function_calls);
621          dolog("Number of compiled function invokations:         %ld",
622                    count_compiled_function_calls);
623          dolog("Number of jni->CallXMethod function invokations: %ld",
624                    count_jni_callXmethod_calls);
625          dolog("Overall number of jni invokations:               %ld",
626                    count_jni_calls);
627 }
628
629
630 /* mem_usagelog ****************************************************************
631
632    prints some memory related infos
633
634 *******************************************************************************/
635
636 void mem_usagelog(bool givewarnings)
637 {
638         if ((memoryusage != 0) && givewarnings) {
639                 dolog("Allocated memory not returned: %d", (s4) memoryusage);
640         }
641
642         if ((globalallocateddumpsize != 0) && givewarnings) {
643                 dolog("Dump memory not returned: %d", (s4) globalallocateddumpsize);
644         }
645
646         dolog("Random/Dump - max. memory usage: %dkB/%dkB", 
647                   (s4) ((maxmemusage + 1023) / 1024),
648                   (s4) ((maxdumpsize + 1023) / 1024));
649 }
650
651
652 /*
653  * These are local overrides for various environment variables in Emacs.
654  * Please do not remove this and leave it at the end of the file, where
655  * Emacs will automagically detect them.
656  * ---------------------------------------------------------------------
657  * Local variables:
658  * mode: c
659  * indent-tabs-mode: t
660  * c-basic-offset: 4
661  * tab-width: 4
662  * End:
663  */