< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "classfile/classLoaderDataGraph.hpp"
  28 #include "classfile/classLoaderStats.hpp"
  29 #include "classfile/javaClasses.hpp"



  30 #include "code/codeCache.hpp"
  31 #include "compiler/compileBroker.hpp"
  32 #include "gc/g1/g1HeapRegionEventSender.hpp"
  33 #include "gc/shared/gcConfiguration.hpp"
  34 #include "gc/shared/gcTrace.hpp"
  35 #include "gc/shared/gcVMOperations.hpp"
  36 #include "gc/shared/objectCountEventSender.hpp"
  37 #include "jfr/jfrEvents.hpp"
  38 #include "jfr/periodic/jfrModuleEvent.hpp"
  39 #include "jfr/periodic/jfrOSInterface.hpp"
  40 #include "jfr/periodic/jfrThreadCPULoadEvent.hpp"
  41 #include "jfr/periodic/jfrThreadDumpEvent.hpp"
  42 #include "jfr/periodic/jfrNetworkUtilization.hpp"
  43 #include "jfr/recorder/jfrRecorder.hpp"
  44 #include "jfr/support/jfrThreadId.hpp"
  45 #include "jfr/utilities/jfrTime.hpp"
  46 #include "jfrfiles/jfrPeriodic.hpp"
  47 #include "logging/log.hpp"
  48 #include "memory/heapInspection.hpp"
  49 #include "memory/resourceArea.hpp"


 489     _stats->iterate(this);
 490   }
 491 };
 492 
 493 class JfrClassLoaderStatsVMOperation : public ClassLoaderStatsVMOperation {
 494  public:
 495   JfrClassLoaderStatsVMOperation() : ClassLoaderStatsVMOperation(NULL) { }
 496 
 497   void doit() {
 498     JfrClassLoaderStatsClosure clsc;
 499     ClassLoaderDataGraph::loaded_cld_do(&clsc);
 500     clsc.createEvents();
 501   }
 502 };
 503 
 504 TRACE_REQUEST_FUNC(ClassLoaderStatistics) {
 505   JfrClassLoaderStatsVMOperation op;
 506   VMThread::execute(&op);
 507 }
 508 




























































































 509 TRACE_REQUEST_FUNC(CompilerStatistics) {
 510   EventCompilerStatistics event;
 511   event.set_compileCount(CompileBroker::get_total_compile_count());
 512   event.set_bailoutCount(CompileBroker::get_total_bailout_count());
 513   event.set_invalidatedCount(CompileBroker::get_total_invalidated_count());
 514   event.set_osrCompileCount(CompileBroker::get_total_osr_compile_count());
 515   event.set_standardCompileCount(CompileBroker::get_total_standard_compile_count());
 516   event.set_osrBytesCompiled(CompileBroker::get_sum_osr_bytes_compiled());
 517   event.set_standardBytesCompiled(CompileBroker::get_sum_standard_bytes_compiled());
 518   event.set_nmetodsSize(CompileBroker::get_sum_nmethod_size());
 519   event.set_nmetodCodeSize(CompileBroker::get_sum_nmethod_code_size());
 520   event.set_peakTimeSpent(CompileBroker::get_peak_compilation_time());
 521   event.set_totalTimeSpent(CompileBroker::get_total_compilation_time());
 522   event.commit();
 523 }
 524 
 525 TRACE_REQUEST_FUNC(CompilerConfiguration) {
 526   EventCompilerConfiguration event;
 527   event.set_threadCount(CICompilerCount);
 528   event.set_tieredCompilation(TieredCompilation);


   1 /*
   2  * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "classfile/classLoaderDataGraph.hpp"
  28 #include "classfile/classLoaderStats.hpp"
  29 #include "classfile/javaClasses.hpp"
  30 #include "classfile/stringTable.hpp"
  31 #include "classfile/symbolTable.hpp"
  32 #include "classfile/systemDictionary.hpp"
  33 #include "code/codeCache.hpp"
  34 #include "compiler/compileBroker.hpp"
  35 #include "gc/g1/g1HeapRegionEventSender.hpp"
  36 #include "gc/shared/gcConfiguration.hpp"
  37 #include "gc/shared/gcTrace.hpp"
  38 #include "gc/shared/gcVMOperations.hpp"
  39 #include "gc/shared/objectCountEventSender.hpp"
  40 #include "jfr/jfrEvents.hpp"
  41 #include "jfr/periodic/jfrModuleEvent.hpp"
  42 #include "jfr/periodic/jfrOSInterface.hpp"
  43 #include "jfr/periodic/jfrThreadCPULoadEvent.hpp"
  44 #include "jfr/periodic/jfrThreadDumpEvent.hpp"
  45 #include "jfr/periodic/jfrNetworkUtilization.hpp"
  46 #include "jfr/recorder/jfrRecorder.hpp"
  47 #include "jfr/support/jfrThreadId.hpp"
  48 #include "jfr/utilities/jfrTime.hpp"
  49 #include "jfrfiles/jfrPeriodic.hpp"
  50 #include "logging/log.hpp"
  51 #include "memory/heapInspection.hpp"
  52 #include "memory/resourceArea.hpp"


 492     _stats->iterate(this);
 493   }
 494 };
 495 
 496 class JfrClassLoaderStatsVMOperation : public ClassLoaderStatsVMOperation {
 497  public:
 498   JfrClassLoaderStatsVMOperation() : ClassLoaderStatsVMOperation(NULL) { }
 499 
 500   void doit() {
 501     JfrClassLoaderStatsClosure clsc;
 502     ClassLoaderDataGraph::loaded_cld_do(&clsc);
 503     clsc.createEvents();
 504   }
 505 };
 506 
 507 TRACE_REQUEST_FUNC(ClassLoaderStatistics) {
 508   JfrClassLoaderStatsVMOperation op;
 509   VMThread::execute(&op);
 510 }
 511 
 512 TRACE_REQUEST_FUNC(SymbolTableStatistics) {
 513   SymbolTable *table = SymbolTable::the_table();
 514   TableStatistics statistics = table->get_table_statistics();
 515   if (statistics._owned) {
 516     //statistics.print(tty, "SymbolTable");
 517     EventSymbolTableStatistics event;
 518     event.set_numberOfBuckets(statistics._number_of_buckets);
 519     event.set_numberOfEntries(statistics._number_of_entries);
 520     event.set_totalFootprint(statistics._total_footprint);
 521     event.set_maximumBucketCount(statistics._maximum_bucket_size);
 522     event.set_averageBucketCount(statistics._average_bucket_size);
 523     event.set_varianceOfBucketCount(statistics._variance_of_bucket_size);
 524     event.set_stdDevOfBucketCount(statistics._stddev_of_bucket_size);
 525     event.set_insertionRate(statistics._add_rate);
 526     event.set_removalRate(statistics._remove_rate);
 527     event.commit();
 528   }
 529 }
 530 
 531 TRACE_REQUEST_FUNC(StringTableStatistics) {
 532   StringTable *table = StringTable::the_table();
 533   TableStatistics statistics = table->get_table_statistics();
 534   if (statistics._owned) {
 535     //statistics.print(tty, "StringTable");
 536     EventStringTableStatistics event;
 537     event.set_numberOfBuckets(statistics._number_of_buckets);
 538     event.set_numberOfEntries(statistics._number_of_entries);
 539     event.set_totalFootprint(statistics._total_footprint);
 540     event.set_maximumBucketCount(statistics._maximum_bucket_size);
 541     event.set_averageBucketCount(statistics._average_bucket_size);
 542     event.set_varianceOfBucketCount(statistics._variance_of_bucket_size);
 543     event.set_stdDevOfBucketCount(statistics._stddev_of_bucket_size);
 544     event.set_insertionRate(statistics._add_rate);
 545     event.set_removalRate(statistics._remove_rate);
 546     event.commit();
 547   }
 548 }
 549 
 550 TRACE_REQUEST_FUNC(PlaceholderTableStatistics) {
 551   TableStatistics statistics = SystemDictionary::placeholders_statistics();
 552   if (statistics._owned) {
 553     //statistics.print(tty, "PlaceholderTable");
 554     EventPlaceholderTableStatistics event;
 555     event.set_numberOfBuckets(statistics._number_of_buckets);
 556     event.set_numberOfEntries(statistics._number_of_entries);
 557     event.set_totalFootprint(statistics._total_footprint);
 558     event.set_maximumBucketCount(statistics._maximum_bucket_size);
 559     event.set_averageBucketCount(statistics._average_bucket_size);
 560     event.set_varianceOfBucketCount(statistics._variance_of_bucket_size);
 561     event.set_stdDevOfBucketCount(statistics._stddev_of_bucket_size);
 562     event.set_insertionRate(statistics._add_rate);
 563     event.set_removalRate(statistics._remove_rate);
 564     event.commit();
 565   }
 566 }
 567 
 568 TRACE_REQUEST_FUNC(LoaderConstraintsTableStatistics) {
 569   TableStatistics statistics = SystemDictionary::loader_constraints_statistics();
 570   if (statistics._owned) {
 571     //statistics.print(tty, "LoaderConstraintsTable");
 572     EventLoaderConstraintsTableStatistics event;
 573     event.set_numberOfBuckets(statistics._number_of_buckets);
 574     event.set_numberOfEntries(statistics._number_of_entries);
 575     event.set_totalFootprint(statistics._total_footprint);
 576     event.set_maximumBucketCount(statistics._maximum_bucket_size);
 577     event.set_averageBucketCount(statistics._average_bucket_size);
 578     event.set_varianceOfBucketCount(statistics._variance_of_bucket_size);
 579     event.set_stdDevOfBucketCount(statistics._stddev_of_bucket_size);
 580     event.set_insertionRate(statistics._add_rate);
 581     event.set_removalRate(statistics._remove_rate);
 582     event.commit();
 583   }
 584 }
 585 
 586 TRACE_REQUEST_FUNC(ProtectionDomainCacheTableStatistics) {
 587   TableStatistics statistics = SystemDictionary::protection_domain_cache_statistics();
 588   if (statistics._owned) {
 589     //statistics.print(tty, "ProtectionDomainCacheTable");
 590     EventProtectionDomainCacheTableStatistics event;
 591     event.set_numberOfBuckets(statistics._number_of_buckets);
 592     event.set_numberOfEntries(statistics._number_of_entries);
 593     event.set_totalFootprint(statistics._total_footprint);
 594     event.set_maximumBucketCount(statistics._maximum_bucket_size);
 595     event.set_averageBucketCount(statistics._average_bucket_size);
 596     event.set_varianceOfBucketCount(statistics._variance_of_bucket_size);
 597     event.set_stdDevOfBucketCount(statistics._stddev_of_bucket_size);
 598     event.set_insertionRate(statistics._add_rate);
 599     event.set_removalRate(statistics._remove_rate);
 600     event.commit();
 601   }
 602 }
 603 
 604 TRACE_REQUEST_FUNC(CompilerStatistics) {
 605   EventCompilerStatistics event;
 606   event.set_compileCount(CompileBroker::get_total_compile_count());
 607   event.set_bailoutCount(CompileBroker::get_total_bailout_count());
 608   event.set_invalidatedCount(CompileBroker::get_total_invalidated_count());
 609   event.set_osrCompileCount(CompileBroker::get_total_osr_compile_count());
 610   event.set_standardCompileCount(CompileBroker::get_total_standard_compile_count());
 611   event.set_osrBytesCompiled(CompileBroker::get_sum_osr_bytes_compiled());
 612   event.set_standardBytesCompiled(CompileBroker::get_sum_standard_bytes_compiled());
 613   event.set_nmetodsSize(CompileBroker::get_sum_nmethod_size());
 614   event.set_nmetodCodeSize(CompileBroker::get_sum_nmethod_code_size());
 615   event.set_peakTimeSpent(CompileBroker::get_peak_compilation_time());
 616   event.set_totalTimeSpent(CompileBroker::get_total_compilation_time());
 617   event.commit();
 618 }
 619 
 620 TRACE_REQUEST_FUNC(CompilerConfiguration) {
 621   EventCompilerConfiguration event;
 622   event.set_threadCount(CICompilerCount);
 623   event.set_tieredCompilation(TieredCompilation);


< prev index next >