112 void print_stats(
void)
120 dolog(
"Number of JIT compiler calls: %6d", count_jit_calls);
122 dolog(
"Number of compiled methods: %6d", count_methods);
125 dolog(
"Number of compiled basic blocks: %6d",
128 dolog(
"Number of max. basic blocks per method: %6d",
129 count_max_basic_blocks);
132 dolog(
"Number of compiled JavaVM instructions: %6d",
135 dolog(
"Number of max. JavaVM instructions per method: %6d",
136 count_max_javainstr);
138 dolog(
"Size of compiled JavaVM instructions: %6d(%d)",
139 count_javacodesize, count_javacodesize - count_methods * 18);
142 dolog(
"Size of compiled Exception Tables: %d", count_javaexcsize);
144 dolog(
"Number of Machine-Instructions: %d", count_code_len >> 2);
146 dolog(
"Number of Spills (write to memory) <all [i/l/a|flt|dbl]>: %d [%d|%d|%d]",
147 count_spills_write_ila + count_spills_write_flt + count_spills_write_dbl,
148 count_spills_write_ila, count_spills_write_flt, count_spills_write_dbl);
150 dolog(
"Number of Spills (read from memory) <all [i/l/a|flt|dbl]>: %d [%d|%d|%d]",
151 count_spills_read_ila + count_spills_read_flt + count_spills_read_dbl,
152 count_spills_read_ila, count_spills_read_flt, count_spills_read_dbl);
154 dolog(
"Number of Activ Pseudocommands: %6d", count_pcmd_activ);
156 dolog(
"Number of Drop Pseudocommands: %6d", count_pcmd_drop);
158 dolog(
"Number of Const Pseudocommands: %6d (zero:%5d)",
159 count_pcmd_load, count_pcmd_zero);
161 dolog(
"Number of ConstAlu Pseudocommands: %6d (cmp: %5d, store:%5d)",
162 count_pcmd_const_alu, count_pcmd_const_bra, count_pcmd_const_store);
164 dolog(
"Number of Move Pseudocommands: %6d", count_pcmd_move);
166 dolog(
"Number of Load Pseudocommands: %6d", count_load_instruction);
169 dolog(
"Number of Store Pseudocommands: %6d (combined: %5d)",
170 count_pcmd_store, count_pcmd_store - count_pcmd_store_comb);
172 dolog(
"Number of OP Pseudocommands: %6d", count_pcmd_op);
174 dolog(
"Number of DUP Pseudocommands: %6d", count_dup_instruction);
176 dolog(
"Number of Mem Pseudocommands: %6d", count_pcmd_mem);
178 dolog(
"Number of Method Pseudocommands: %6d", count_pcmd_met);
180 dolog(
"Number of Branch Pseudocommands: %6d (rets:%5d, Xrets: %5d)",
181 count_pcmd_bra, count_pcmd_return, count_pcmd_returnx);
183 log_println(
" resolved branches: %6d", count_branches_resolved);
185 log_println(
" unresolved branches: %6d", count_branches_unresolved);
187 dolog(
"Number of Table Pseudocommands: %6d", count_pcmd_table);
188 dolog(
"Number of Useful Pseudocommands: %6d", count_pcmd_table +
189 count_pcmd_bra + count_pcmd_load + count_pcmd_mem + count_pcmd_op);
191 dolog(
"Number of Null Pointer Checks: %6d", count_check_null);
193 dolog(
"Number of Array Bound Checks: %6d", count_check_bound);
195 dolog(
"Number of Try-Blocks: %d", count_tryblocks);
198 dolog(
"Number of branch_emit (total, 8bit/16bit/32bit/64bit offset): %d, %d/%d/%d/%d",
199 count_emit_branch, count_emit_branch_8bit, count_emit_branch_16bit,
200 count_emit_branch_32bit, count_emit_branch_64bit);
203 dolog(
"Maximal count of stack elements: %d", count_max_new_stack);
205 dolog(
"Upper bound of max stack elements: %d", count_upper_bound_new_stack);
207 dolog(
"Distribution of stack sizes at block boundary");
208 dolog(
" 0 1 2 3 4 5 6 7 8 9 >=10");
209 dolog(
"%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
210 count_block_stack[0], count_block_stack[1], count_block_stack[2],
211 count_block_stack[3], count_block_stack[4], count_block_stack[5],
212 count_block_stack[6], count_block_stack[7], count_block_stack[8],
213 count_block_stack[9], count_block_stack[10]);
215 dolog(
"Distribution of store stack depth");
216 dolog(
" 0 1 2 3 4 5 6 7 8 9 >=10");
217 dolog(
"%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
218 count_store_depth[0], count_store_depth[1], count_store_depth[2],
219 count_store_depth[3], count_store_depth[4], count_store_depth[5],
220 count_store_depth[6], count_store_depth[7], count_store_depth[8],
221 count_store_depth[9], count_store_depth[10]);
222 dolog(
"Distribution of store creator chains first part");
223 dolog(
" 0 1 2 3 4 5 6 7 8 9");
225 dolog(
"%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
226 count_store_length[0], count_store_length[1], count_store_length[2],
227 count_store_length[3], count_store_length[4], count_store_length[5],
228 count_store_length[6], count_store_length[7], count_store_length[8],
229 count_store_length[9]);
231 dolog(
"Distribution of store creator chains second part");
232 dolog(
" 10 11 12 13 14 15 16 17 18 19 >=20");
233 dolog(
"%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
234 count_store_length[10], count_store_length[11],
235 count_store_length[12], count_store_length[13],
236 count_store_length[14], count_store_length[15],
237 count_store_length[16], count_store_length[17],
238 count_store_length[18], count_store_length[19],
239 count_store_length[20]);
241 dolog(
"Distribution of analysis iterations");
242 dolog(
" 1 2 3 4 >=5");
243 dolog(
"%6d%6d%6d%6d%6d",
244 count_analyse_iterations[0], count_analyse_iterations[1],
245 count_analyse_iterations[2], count_analyse_iterations[3],
246 count_analyse_iterations[4]);
252 log_println(
"Distribution of basic blocks per method:");
253 log_println(
" <=5 <=10 <=15 <=20 <=30 <=40 <=50 <=75 >75");
256 for (i = 0; i <= 8; i++)
257 log_print(
"%6d", count_method_bb_distribution[i]);
262 f = (float) count_methods;
265 for (i = 0; i <= 8; i++)
266 log_print(
"%6.2f", (
float) count_method_bb_distribution[i] / f);
272 for (i = 0, sum = 0; i <= 8; i++) {
273 sum += count_method_bb_distribution[
i];
283 log_println(
" 0 1 2 3 4 5 6 7 8 9 <13 <15 <17 <19 <21 <26 <31 >30");
288 for (i = 0; i <= 17; i++)
289 log_print(
"%6d", count_block_size_distribution[i]);
294 f = (float) count_basic_blocks;
297 for (i = 0; i <= 17; i++)
298 log_print(
"%6.2f", (
float) count_block_size_distribution[i] / f);
304 for (i = 0, sum = 0; i <= 17; i++) {
305 sum += count_block_size_distribution[
i];
311 statistics_print_memory_usage();
314 dolog(
"Number of class loads: %6d", count_class_loads);
316 dolog(
"Number of class inits: %6d", count_class_inits);
318 dolog(
"Number of loaded Methods: %6d\n", count_all_methods);
321 dolog(
"Calls of utf_new: %6d", count_utf_new);
323 dolog(
"Calls of utf_new (element found): %6d\n", count_utf_new_found);
329 dolog(
"Moves reg -> reg: %6d", count_mov_reg_reg);
331 dolog(
"Moves mem -> reg: %6d", count_mov_mem_reg);
333 dolog(
"Moves reg -> mem: %6d", count_mov_reg_mem);
335 dolog(
"Moves mem -> mem: %6d", count_mov_mem_mem);
338 dolog(
"Methods allocated by LSRA: %6d",
339 count_methods_allocated_by_lsra);
341 dolog(
"Conflicts between local Variables: %6d", count_locals_conflicts);
343 dolog(
"Local Variables held in Memory: %6d", count_locals_spilled);
345 dolog(
"Local Variables held in Registers: %6d", count_locals_register);
347 dolog(
"Stackslots held in Memory: %6d", count_ss_spilled);
349 dolog(
"Stackslots held in Registers: %6d", count_ss_register);
351 dolog(
"Memory moves at BB Boundaries: %6d", count_mem_move_bb);
353 dolog(
"Number of interface slots: %6d\n", count_interface_size);
355 dolog(
"Number of Argument stack slots in register: %6d",
356 count_argument_reg_ss);
358 dolog(
"Number of Argument stack slots in memory: %6d\n",
359 count_argument_mem_ss);
361 dolog(
"Number of Methods kept in registers: %6d\n",
362 count_method_in_register);
367 #if defined(USE_SCHEDULER)
368 dolog(
"Instruction scheduler statistics:");
369 dolog(
"Number of basic blocks: %7d", count_schedule_basic_blocks);
370 dolog(
"Number of nodes: %7d", count_schedule_nodes);
371 dolog(
"Number of leaders nodes: %7d", count_schedule_leaders);
372 dolog(
"Number of max. leaders nodes: %7d", count_schedule_max_leaders);
373 dolog(
"Length of critical path: %7d\n", count_schedule_critical_path);
379 dolog(
"Function call statistics:");
381 dolog(
"Number of jni->CallXMethod function invokations: %ld",
382 count_jni_callXmethod_calls);
384 dolog(
"Overall number of jni invokations: %ld",
388 log_println(
"java-to-native calls: %10ld", count_calls_java_to_native);
390 log_println(
"native-to-java calls: %10ld", count_calls_native_to_java);
395 #if defined(ENABLE_INTRP)
406 void statistics_print_date(
void)
411 #if defined(HAVE_TIME)
417 #if defined(HAVE_LOCALTIME_R)
418 localtime_r(&t, &tm);
420 # error !HAVE_LOCALTIME_R
424 1900 + tm.tm_year, tm.tm_mon + 1, tm.tm_mday,
425 tm.tm_hour, tm.tm_min, tm.tm_sec);
435 void statistics_print_memory_usage(
void)
439 log_println(
"memory usage ----------------------");
471 log_println(
"linenumber tables (%5d): %10d", count_linenumbertable, size_linenumbertable);
472 log_println(
"exception tables: %10d", count_extable_len);
473 log_println(
"patcher references: %10d", size_patchref);
477 size_linenumbertable +
485 log_println(
"constant pool: %10d", count_const_pool_len);
487 log_println(
"parsed descriptors: %10d", count_parsed_desc_len);
489 log_println(
"compiler stubs: %10d", count_cstub_len);
490 log_println(
"native stubs: %10d", size_stub_native);
495 log_println(
"threadobject: %10d", size_threadobject);
496 log_println(
"thread index: %10d", size_thread_index_t);
498 log_println(
"lock record: %10d", size_lock_record);
499 log_println(
"lock hashtable: %10d", size_lock_hashtable);
500 log_println(
"lock waiter: %10d", size_lock_waiter);
504 count_const_pool_len +
506 count_parsed_desc_len +
515 size_thread_index_t +
518 size_lock_hashtable +
525 log_println(
"max. code memory: %10d", maxcodememusage);
526 log_println(
"max. heap memory: %10d", maxmemusage);
527 log_println(
"max. dump memory: %10d", maxdumpsize);
529 log_println(
"heap memory not freed: %10d", (int32_t) memoryusage);
530 log_println(
"dump memory not freed: %10d", (int32_t) globalallocateddumpsize);
542 void statistics_print_gc_memory_usage(
void)
544 static int64_t count = 0;
561 fprintf(
opt_ProfileMemoryUsageGNUPlot,
"plot \"profile.dat\" using 1:2 with lines title \"max. Java heap size\", \"profile.dat\" using 1:3 with lines title \"Java heap size\", \"profile.dat\" using 1:4 with lines title \"used\", \"profile.dat\" using 1:5 with lines title \"free\"\n");
564 "%" PRId64
" %" PRId64
" %" PRId64
" %" PRId64
" %" PRId64
"\n",
565 count, max, size, used, free);
570 log_println(
"GC memory usage -------------------");
#define RT_TIMER_STOP(var)
Stop the timer var.
static s4 compilingtime_recursion
#define RT_TIMER_START(var)
Start the timer var.
void log_println(const char *text,...)
JNIEnv jthread jobject jclass jlong size
s8 gc_get_free_bytes(void)
s8 gc_get_max_heap_size(void)
#define RT_REGISTER_GROUP(var, name, description)
Register a new (toplevel) group.
void log_print(const char *text,...)
#define RT_REGISTER_GROUP_TIMER(var, name, description, group)
Register a new timer.
s8 gc_get_total_bytes(void)
This file contains the statistics framework.
FILE * opt_ProfileMemoryUsageGNUPlot
This file contains the real-time timing utilities.
void compilingtime_start(void)
void loadingtime_stop(void)
s8 gc_get_heap_size(void)
static s4 loadingtime_recursion
void print_dynamic_super_statistics(void)
void compilingtime_stop(void)
void loadingtime_start(void)