Skip to content

Commit

Permalink
8317761: Combine two versions of print_statistics() in java.cpp
Browse files Browse the repository at this point in the history
Reviewed-by: kvn, vlivanov
  • Loading branch information
iklam committed Oct 11, 2023
1 parent 3aa4cba commit 84b7cc1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 51 deletions.
57 changes: 7 additions & 50 deletions src/hotspot/share/runtime/java.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ void print_bytecode_count() {
}
}

#else

void print_method_invocation_histogram() {}
void print_bytecode_count() {}

#endif // PRODUCT


// General statistics printing (profiling ...)
void print_statistics() {
Expand Down Expand Up @@ -337,56 +344,6 @@ void print_statistics() {
ThreadsSMRSupport::log_statistics();
}

#else // PRODUCT MODE STATISTICS

void print_statistics() {

if (PrintMethodData) {
print_method_profiling_data();
}

if (CITime) {
CompileBroker::print_times();
}

#ifdef COMPILER2_OR_JVMCI
if ((LogVMOutput || LogCompilation) && UseCompiler) {
// Only print the statistics to the log file
FlagSetting fs(DisplayVMOutput, false);
Deoptimization::print_statistics();
}
#endif /* COMPILER2 || INCLUDE_JVMCI */

if (PrintCodeCache) {
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CodeCache::print();
}

// CodeHeap State Analytics.
if (PrintCodeHeapAnalytics) {
CompileBroker::print_heapinfo(nullptr, "all", 4096); // details
}

#ifdef COMPILER2
if (PrintPreciseRTMLockingStatistics) {
OptoRuntime::print_named_counters();
}
#endif

// Native memory tracking data
if (PrintNMTStatistics) {
MemTracker::final_report(tty);
}

if (PrintMetaspaceStatisticsAtExit) {
MetaspaceUtils::print_basic_report(tty, 0);
}

ThreadsSMRSupport::log_statistics();
}

#endif

// Note: before_exit() can be executed only once, if more than one threads
// are trying to shutdown the VM at the same time, only one thread
// can run before_exit() and all other threads must wait.
Expand Down
3 changes: 2 additions & 1 deletion src/hotspot/share/runtime/sharedRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,11 @@ class SharedRuntime: AllStatic {
static address nof_interface_calls_addr() { return (address)&_nof_interface_calls; }
static address nof_inlined_interface_calls_addr() { return (address)&_nof_inlined_interface_calls; }
static void print_call_statistics(uint64_t comp_total);
static void print_statistics();
static void print_ic_miss_histogram();

#endif // PRODUCT

static void print_statistics() PRODUCT_RETURN;
};


Expand Down

1 comment on commit 84b7cc1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.