< prev index next >

src/share/vm/jfr/periodic/jfrPeriodic.cpp

Print this page
rev 9055 : 8223438: add VirtualizationInformation JFR event
Reviewed-by: clanger, egahlin
rev 9056 : 8185525: Add JFR event for DictionarySizes
Summary: Added TableStatistics event
Reviewed-by: egahlin, coleenp

@@ -24,10 +24,12 @@
 
 #include "precompiled.hpp"
 #include "jvm.h"
 #include "classfile/classLoaderStats.hpp"
 #include "classfile/javaClasses.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
 #include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "gc_implementation/g1/g1HeapRegionEventSender.hpp"
 #include "gc_implementation/shared/gcConfiguration.hpp"
 #include "gc_implementation/shared/gcTrace.hpp"

@@ -85,10 +87,16 @@
   EventOSInformation event;
   event.set_osVersion(os_name);
   event.commit();
 }
 
+TRACE_REQUEST_FUNC(VirtualizationInformation) {
+  EventVirtualizationInformation event;
+  event.set_name(JfrOSInterface::virtualization_name());
+  event.commit();
+}
+
 /*
  * This is left empty on purpose, having ExecutionSample as a requestable
  * is a way of getting the period. The period is passed to ThreadSampling::update_period.
  * Implementation in jfrSamples.cpp
  */

@@ -490,10 +498,50 @@
 TRACE_REQUEST_FUNC(ClassLoaderStatistics) {
   JfrClassLoaderStatsVMOperation op;
   VMThread::execute(&op);
 }
 
+template<typename EVENT>
+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<EventSymbolTableStatistics>(statistics);
+}
+
+TRACE_REQUEST_FUNC(StringTableStatistics) {
+  TableStatistics statistics = StringTable::the_table()->get_table_statistics();
+  emit_table_statistics<EventStringTableStatistics>(statistics);
+}
+
+TRACE_REQUEST_FUNC(PlaceholderTableStatistics) {
+  TableStatistics statistics = SystemDictionary::placeholders_statistics();
+  emit_table_statistics<EventPlaceholderTableStatistics>(statistics);
+}
+
+TRACE_REQUEST_FUNC(LoaderConstraintsTableStatistics) {
+  TableStatistics statistics = SystemDictionary::loader_constraints_statistics();
+  emit_table_statistics<EventLoaderConstraintsTableStatistics>(statistics);
+}
+
+TRACE_REQUEST_FUNC(ProtectionDomainCacheTableStatistics) {
+  TableStatistics statistics = SystemDictionary::protection_domain_cache_statistics();
+  emit_table_statistics<EventProtectionDomainCacheTableStatistics>(statistics);
+}
+
 TRACE_REQUEST_FUNC(CompilerStatistics) {
   EventCompilerStatistics event;
   event.set_compileCount(CompileBroker::get_total_compile_count());
   event.set_bailoutCount(CompileBroker::get_total_bailout_count());
   event.set_invalidatedCount(CompileBroker::get_total_invalidated_count());
< prev index next >