35 #include "memory/universe.hpp"
36 #include "oops/constantPool.hpp"
37 #include "oops/generateOopMap.hpp"
38 #include "oops/instanceKlass.hpp"
39 #include "oops/instanceOop.hpp"
40 #include "oops/method.hpp"
41 #include "oops/objArrayOop.hpp"
42 #include "oops/oop.inline.hpp"
43 #include "oops/symbol.hpp"
44 #include "prims/jvmtiExport.hpp"
45 #include "runtime/arguments.hpp"
46 #include "runtime/biasedLocking.hpp"
47 #include "runtime/compilationPolicy.hpp"
48 #include "runtime/fprofiler.hpp"
49 #include "runtime/init.hpp"
50 #include "runtime/interfaceSupport.hpp"
51 #include "runtime/java.hpp"
52 #include "runtime/memprofiler.hpp"
53 #include "runtime/sharedRuntime.hpp"
54 #include "runtime/statSampler.hpp"
55 #include "runtime/task.hpp"
56 #include "runtime/thread.inline.hpp"
57 #include "runtime/timer.hpp"
58 #include "runtime/vm_operations.hpp"
59 #include "services/memReporter.hpp"
60 #include "services/memTracker.hpp"
61 #include "trace/tracing.hpp"
62 #include "utilities/dtrace.hpp"
63 #include "utilities/globalDefinitions.hpp"
64 #include "utilities/histogram.hpp"
65 #include "utilities/macros.hpp"
66 #include "utilities/vmError.hpp"
67 #ifdef TARGET_ARCH_x86
68 # include "vm_version_x86.hpp"
69 #endif
70 #ifdef TARGET_ARCH_sparc
71 # include "vm_version_sparc.hpp"
72 #endif
73 #ifdef TARGET_ARCH_zero
74 # include "vm_version_zero.hpp"
191 //m->print_name(tty);
192 m->print_invocation_count();
193 tty->cr();
194 m->print_codes();
195 }
196 tty->print_cr("------------------------------------------------------------------------");
197 }
198 }
199
200 void print_bytecode_count() {
201 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
202 tty->print_cr("[BytecodeCounter::counter_value = %d]", BytecodeCounter::counter_value());
203 }
204 }
205
206 AllocStats alloc_stats;
207
208
209
210 // General statistics printing (profiling ...)
211
212 void print_statistics() {
213
214 #ifdef ASSERT
215
216 if (CountRuntimeCalls) {
217 extern Histogram *RuntimeHistogram;
218 RuntimeHistogram->print();
219 }
220
221 if (CountJNICalls) {
222 extern Histogram *JNIHistogram;
223 JNIHistogram->print();
224 }
225
226 if (CountJVMCalls) {
227 extern Histogram *JVMHistogram;
228 JVMHistogram->print();
229 }
230
231 #endif
232
233 if (MemProfiling) {
289 GenerateOopMap::print_time();
290 }
291 if (ProfilerCheckIntervals) {
292 PeriodicTask::print_intervals();
293 }
294 if (PrintSymbolTableSizeHistogram) {
295 SymbolTable::print_histogram();
296 }
297 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
298 BytecodeCounter::print();
299 }
300 if (PrintBytecodePairHistogram) {
301 BytecodePairHistogram::print();
302 }
303
304 if (PrintCodeCache) {
305 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
306 CodeCache::print();
307 }
308
309 if (PrintCodeCache2) {
310 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
311 CodeCache::print_internals();
312 }
313
314 if (PrintClassStatistics) {
315 SystemDictionary::print_class_statistics();
316 }
317 if (PrintMethodStatistics) {
318 SystemDictionary::print_method_statistics();
319 }
320
321 if (PrintVtableStats) {
322 klassVtable::print_statistics();
323 klassItable::print_statistics();
324 }
325 if (VerifyOops) {
326 tty->print_cr("+VerifyOops count: %d", StubRoutines::verify_oop_count());
327 }
328
354 if (MemTracker::is_on()) {
355 BaselineTTYOutputer outputer(tty);
356 MemTracker::print_memory_usage(outputer, K, false);
357 } else {
358 tty->print_cr(MemTracker::reason());
359 }
360 }
361 }
362
363 #else // PRODUCT MODE STATISTICS
364
365 void print_statistics() {
366
367 if (CITime) {
368 CompileBroker::print_times();
369 }
370
371 if (PrintCodeCache) {
372 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
373 CodeCache::print();
374 }
375
376 #ifdef COMPILER2
377 if (PrintPreciseBiasedLockingStatistics) {
378 OptoRuntime::print_named_counters();
379 }
380 #endif
381 if (PrintBiasedLockingStatistics) {
382 BiasedLocking::print_counters();
383 }
384
385 // Native memory tracking data
386 if (PrintNMTStatistics) {
387 if (MemTracker::is_on()) {
388 BaselineTTYOutputer outputer(tty);
389 MemTracker::print_memory_usage(outputer, K, false);
390 } else {
391 tty->print_cr(MemTracker::reason());
392 }
393 }
|
35 #include "memory/universe.hpp"
36 #include "oops/constantPool.hpp"
37 #include "oops/generateOopMap.hpp"
38 #include "oops/instanceKlass.hpp"
39 #include "oops/instanceOop.hpp"
40 #include "oops/method.hpp"
41 #include "oops/objArrayOop.hpp"
42 #include "oops/oop.inline.hpp"
43 #include "oops/symbol.hpp"
44 #include "prims/jvmtiExport.hpp"
45 #include "runtime/arguments.hpp"
46 #include "runtime/biasedLocking.hpp"
47 #include "runtime/compilationPolicy.hpp"
48 #include "runtime/fprofiler.hpp"
49 #include "runtime/init.hpp"
50 #include "runtime/interfaceSupport.hpp"
51 #include "runtime/java.hpp"
52 #include "runtime/memprofiler.hpp"
53 #include "runtime/sharedRuntime.hpp"
54 #include "runtime/statSampler.hpp"
55 #include "runtime/sweeper.hpp"
56 #include "runtime/task.hpp"
57 #include "runtime/thread.inline.hpp"
58 #include "runtime/timer.hpp"
59 #include "runtime/vm_operations.hpp"
60 #include "services/memReporter.hpp"
61 #include "services/memTracker.hpp"
62 #include "trace/tracing.hpp"
63 #include "utilities/dtrace.hpp"
64 #include "utilities/globalDefinitions.hpp"
65 #include "utilities/histogram.hpp"
66 #include "utilities/macros.hpp"
67 #include "utilities/vmError.hpp"
68 #ifdef TARGET_ARCH_x86
69 # include "vm_version_x86.hpp"
70 #endif
71 #ifdef TARGET_ARCH_sparc
72 # include "vm_version_sparc.hpp"
73 #endif
74 #ifdef TARGET_ARCH_zero
75 # include "vm_version_zero.hpp"
192 //m->print_name(tty);
193 m->print_invocation_count();
194 tty->cr();
195 m->print_codes();
196 }
197 tty->print_cr("------------------------------------------------------------------------");
198 }
199 }
200
201 void print_bytecode_count() {
202 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
203 tty->print_cr("[BytecodeCounter::counter_value = %d]", BytecodeCounter::counter_value());
204 }
205 }
206
207 AllocStats alloc_stats;
208
209
210
211 // General statistics printing (profiling ...)
212 void print_statistics() {
213 #ifdef ASSERT
214
215 if (CountRuntimeCalls) {
216 extern Histogram *RuntimeHistogram;
217 RuntimeHistogram->print();
218 }
219
220 if (CountJNICalls) {
221 extern Histogram *JNIHistogram;
222 JNIHistogram->print();
223 }
224
225 if (CountJVMCalls) {
226 extern Histogram *JVMHistogram;
227 JVMHistogram->print();
228 }
229
230 #endif
231
232 if (MemProfiling) {
288 GenerateOopMap::print_time();
289 }
290 if (ProfilerCheckIntervals) {
291 PeriodicTask::print_intervals();
292 }
293 if (PrintSymbolTableSizeHistogram) {
294 SymbolTable::print_histogram();
295 }
296 if (CountBytecodes || TraceBytecodes || StopInterpreterAt) {
297 BytecodeCounter::print();
298 }
299 if (PrintBytecodePairHistogram) {
300 BytecodePairHistogram::print();
301 }
302
303 if (PrintCodeCache) {
304 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
305 CodeCache::print();
306 }
307
308 if (PrintMethodFlushingStatistics) {
309 NMethodSweeper::print();
310 }
311
312 if (PrintCodeCache2) {
313 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
314 CodeCache::print_internals();
315 }
316
317 if (PrintClassStatistics) {
318 SystemDictionary::print_class_statistics();
319 }
320 if (PrintMethodStatistics) {
321 SystemDictionary::print_method_statistics();
322 }
323
324 if (PrintVtableStats) {
325 klassVtable::print_statistics();
326 klassItable::print_statistics();
327 }
328 if (VerifyOops) {
329 tty->print_cr("+VerifyOops count: %d", StubRoutines::verify_oop_count());
330 }
331
357 if (MemTracker::is_on()) {
358 BaselineTTYOutputer outputer(tty);
359 MemTracker::print_memory_usage(outputer, K, false);
360 } else {
361 tty->print_cr(MemTracker::reason());
362 }
363 }
364 }
365
366 #else // PRODUCT MODE STATISTICS
367
368 void print_statistics() {
369
370 if (CITime) {
371 CompileBroker::print_times();
372 }
373
374 if (PrintCodeCache) {
375 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
376 CodeCache::print();
377 }
378
379 if (PrintMethodFlushingStatistics) {
380 NMethodSweeper::print();
381 }
382
383 #ifdef COMPILER2
384 if (PrintPreciseBiasedLockingStatistics) {
385 OptoRuntime::print_named_counters();
386 }
387 #endif
388 if (PrintBiasedLockingStatistics) {
389 BiasedLocking::print_counters();
390 }
391
392 // Native memory tracking data
393 if (PrintNMTStatistics) {
394 if (MemTracker::is_on()) {
395 BaselineTTYOutputer outputer(tty);
396 MemTracker::print_memory_usage(outputer, K, false);
397 } else {
398 tty->print_cr(MemTracker::reason());
399 }
400 }
|