< 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  *


  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"
  50 #include "oops/oop.inline.hpp"
  51 #include "runtime/arguments.hpp"
  52 #include "runtime/flags/jvmFlag.hpp"
  53 #include "runtime/globals.hpp"
  54 #include "runtime/os.hpp"
  55 #include "runtime/os_perf.hpp"
  56 #include "runtime/thread.inline.hpp"
  57 #include "runtime/threadSMR.hpp"
  58 #include "runtime/sweeper.hpp"
  59 #include "runtime/vmThread.hpp"
  60 #include "services/classLoadingService.hpp"
  61 #include "services/management.hpp"
  62 #include "services/threadService.hpp"
  63 #include "utilities/exceptions.hpp"
  64 #include "utilities/globalDefinitions.hpp"
  65 


  66 /**
  67  *  JfrPeriodic class
  68  *  Implementation of declarations in
  69  *  xsl generated traceRequestables.hpp
  70  */
  71 #define TRACE_REQUEST_FUNC(id)    void JfrPeriodicEventSet::request##id(void)
  72 
  73 TRACE_REQUEST_FUNC(JVMInformation) {
  74   ResourceMark rm;
  75   EventJVMInformation event;
  76   event.set_jvmName(VM_Version::vm_name());
  77   event.set_jvmVersion(VM_Version::internal_vm_info_string());
  78   event.set_javaArguments(Arguments::java_command());
  79   event.set_jvmArguments(Arguments::jvm_args());
  80   event.set_jvmFlags(Arguments::jvm_flags());
  81   event.set_jvmStartTime(Management::vm_init_done_time());
  82   event.set_pid(os::current_process_id());
  83   event.commit();
  84  }
  85 


 560   event.set_reservedTopAddress((u8)CodeCache::high_bound());
 561   event.commit();
 562 }
 563 
 564 TRACE_REQUEST_FUNC(CodeSweeperStatistics) {
 565   EventCodeSweeperStatistics event;
 566   event.set_sweepCount(NMethodSweeper::traversal_count());
 567   event.set_methodReclaimedCount(NMethodSweeper::total_nof_methods_reclaimed());
 568   event.set_totalSweepTime(NMethodSweeper::total_time_sweeping());
 569   event.set_peakFractionTime(NMethodSweeper::peak_sweep_fraction_time());
 570   event.set_peakSweepTime(NMethodSweeper::peak_sweep_time());
 571   event.commit();
 572 }
 573 
 574 TRACE_REQUEST_FUNC(CodeSweeperConfiguration) {
 575   EventCodeSweeperConfiguration event;
 576   event.set_sweeperEnabled(MethodFlushing);
 577   event.set_flushingEnabled(UseCodeCacheFlushing);
 578   event.commit();
 579 }









   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  *


  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"
  50 #include "oops/oop.inline.hpp"
  51 #include "runtime/arguments.hpp"
  52 #include "runtime/flags/jvmFlag.hpp"
  53 #include "runtime/globals.hpp"
  54 #include "runtime/os.hpp"
  55 #include "runtime/os_perf.hpp"
  56 #include "runtime/thread.inline.hpp"
  57 #include "runtime/threadSMR.hpp"
  58 #include "runtime/sweeper.hpp"
  59 #include "runtime/vmThread.hpp"
  60 #include "services/classLoadingService.hpp"
  61 #include "services/management.hpp"
  62 #include "services/threadService.hpp"
  63 #include "utilities/exceptions.hpp"
  64 #include "utilities/globalDefinitions.hpp"
  65 #if INCLUDE_SHENANDOAHGC
  66 #include "gc/shenandoah/shenandoahJfrSupport.hpp"
  67 #endif
  68 /**
  69  *  JfrPeriodic class
  70  *  Implementation of declarations in
  71  *  xsl generated traceRequestables.hpp
  72  */
  73 #define TRACE_REQUEST_FUNC(id)    void JfrPeriodicEventSet::request##id(void)
  74 
  75 TRACE_REQUEST_FUNC(JVMInformation) {
  76   ResourceMark rm;
  77   EventJVMInformation event;
  78   event.set_jvmName(VM_Version::vm_name());
  79   event.set_jvmVersion(VM_Version::internal_vm_info_string());
  80   event.set_javaArguments(Arguments::java_command());
  81   event.set_jvmArguments(Arguments::jvm_args());
  82   event.set_jvmFlags(Arguments::jvm_flags());
  83   event.set_jvmStartTime(Management::vm_init_done_time());
  84   event.set_pid(os::current_process_id());
  85   event.commit();
  86  }
  87 


 562   event.set_reservedTopAddress((u8)CodeCache::high_bound());
 563   event.commit();
 564 }
 565 
 566 TRACE_REQUEST_FUNC(CodeSweeperStatistics) {
 567   EventCodeSweeperStatistics event;
 568   event.set_sweepCount(NMethodSweeper::traversal_count());
 569   event.set_methodReclaimedCount(NMethodSweeper::total_nof_methods_reclaimed());
 570   event.set_totalSweepTime(NMethodSweeper::total_time_sweeping());
 571   event.set_peakFractionTime(NMethodSweeper::peak_sweep_fraction_time());
 572   event.set_peakSweepTime(NMethodSweeper::peak_sweep_time());
 573   event.commit();
 574 }
 575 
 576 TRACE_REQUEST_FUNC(CodeSweeperConfiguration) {
 577   EventCodeSweeperConfiguration event;
 578   event.set_sweeperEnabled(MethodFlushing);
 579   event.set_flushingEnabled(UseCodeCacheFlushing);
 580   event.commit();
 581 }
 582 
 583 #if INCLUDE_SHENANDOAHGC
 584 TRACE_REQUEST_FUNC(ShenandoahHeapRegionInformation) {
 585   if (UseShenandoahGC) {
 586     VM_ShenandoahSendHeapRegionInfoEvents op;
 587     VMThread::execute(&op);
 588   }
 589 }
 590 #endif
< prev index next >