diff -r 2584e5772546 -r 865ec913f916 src/hotspot/share/jfr/periodic/jfrPeriodic.cpp --- a/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp Wed May 08 20:57:12 2019 +0800 +++ b/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp Wed May 08 11:11:50 2019 -0500 @@ -27,6 +27,9 @@ #include "classfile/classLoaderDataGraph.hpp" #include "classfile/classLoaderStats.hpp" #include "classfile/javaClasses.hpp" +#include "classfile/stringTable.hpp" +#include "classfile/symbolTable.hpp" +#include "classfile/systemDictionary.hpp" #include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "gc/g1/g1HeapRegionEventSender.hpp" @@ -506,6 +509,46 @@ VMThread::execute(&op); } +template +static void emit_table_statistics(TableStatistics statistics) { + EVENT event; + event.set_bucketCount(statistics._number_of_buckets); + event.set_entryCount(statistics._number_of_entries); + event.set_totalFootprint(statistics._total_footprint); + event.set_bucketCountMaximum(statistics._maximum_bucket_size); + event.set_bucketCountAverage(statistics._average_bucket_size); + event.set_bucketCountVariance(statistics._variance_of_bucket_size); + event.set_bucketCountStandardDeviation(statistics._stddev_of_bucket_size); + event.set_insertionRate(statistics._add_rate); + event.set_removalRate(statistics._remove_rate); + event.commit(); +} + +TRACE_REQUEST_FUNC(SymbolTableStatistics) { + TableStatistics statistics = SymbolTable::the_table()->get_table_statistics(); + emit_table_statistics(statistics); +} + +TRACE_REQUEST_FUNC(StringTableStatistics) { + TableStatistics statistics = StringTable::the_table()->get_table_statistics(); + emit_table_statistics(statistics); +} + +TRACE_REQUEST_FUNC(PlaceholderTableStatistics) { + TableStatistics statistics = SystemDictionary::placeholders_statistics(); + emit_table_statistics(statistics); +} + +TRACE_REQUEST_FUNC(LoaderConstraintsTableStatistics) { + TableStatistics statistics = SystemDictionary::loader_constraints_statistics(); + emit_table_statistics(statistics); +} + +TRACE_REQUEST_FUNC(ProtectionDomainCacheTableStatistics) { + TableStatistics statistics = SystemDictionary::protection_domain_cache_statistics(); + emit_table_statistics(statistics); +} + TRACE_REQUEST_FUNC(CompilerStatistics) { EventCompilerStatistics event; event.set_compileCount(CompileBroker::get_total_compile_count());