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/objectCountEventSender.hpp"
36 #include "gc/shared/vmGCOperations.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"
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.commit();
83 }
84
85 TRACE_REQUEST_FUNC(OSInformation) {
294
295 TRACE_REQUEST_FUNC(StringFlag) {
296 SEND_FLAGS_OF_TYPE(StringFlag, ccstr);
297 }
298
299 class VM_GC_SendObjectCountEvent : public VM_GC_HeapInspection {
300 public:
301 VM_GC_SendObjectCountEvent() : VM_GC_HeapInspection(NULL, true) {}
302 virtual void doit() {
303 ObjectCountEventSender::enable_requestable_event();
304 collect();
305 ObjectCountEventSender::disable_requestable_event();
306 }
307 };
308
309 TRACE_REQUEST_FUNC(ObjectCount) {
310 VM_GC_SendObjectCountEvent op;
311 VMThread::execute(&op);
312 }
313
314 class VM_G1SendHeapRegionInfoEvents : public VM_Operation {
315 virtual void doit() {
316 G1HeapRegionEventSender::send_events();
317 }
318 virtual VMOp_Type type() const { return VMOp_HeapIterateOperation; }
319 };
320
321 TRACE_REQUEST_FUNC(G1HeapRegionInformation) {
322 if (UseG1GC) {
323 VM_G1SendHeapRegionInfoEvents op;
324 VMThread::execute(&op);
325 }
326 }
327
328 // Java Mission Control (JMC) uses (Java) Long.MIN_VALUE to describe that a
329 // long value is undefined.
330 static jlong jmc_undefined_long = min_jlong;
331
332 TRACE_REQUEST_FUNC(GCConfiguration) {
333 GCConfiguration conf;
334 jlong pause_target = conf.has_pause_target_default_value() ? jmc_undefined_long : conf.pause_target();
335 EventGCConfiguration event;
336 event.set_youngCollector(conf.young_collector());
337 event.set_oldCollector(conf.old_collector());
338 event.set_parallelGCThreads(conf.num_parallel_gc_threads());
339 event.set_concurrentGCThreads(conf.num_concurrent_gc_threads());
340 event.set_usesDynamicGCThreads(conf.uses_dynamic_gc_threads());
341 event.set_isExplicitGCConcurrent(conf.is_explicit_gc_concurrent());
342 event.set_isExplicitGCDisabled(conf.is_explicit_gc_disabled());
343 event.set_gcTimeRatio(conf.gc_time_ratio());
344 event.set_pauseTarget((s8)pause_target);
345 event.commit();
|
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/shared/gcConfiguration.hpp"
33 #include "gc/shared/gcTrace.hpp"
34 #include "gc/shared/objectCountEventSender.hpp"
35 #include "gc/shared/vmGCOperations.hpp"
36 #include "jfr/jfrEvents.hpp"
37 #include "jfr/periodic/jfrModuleEvent.hpp"
38 #include "jfr/periodic/jfrOSInterface.hpp"
39 #include "jfr/periodic/jfrThreadCPULoadEvent.hpp"
40 #include "jfr/periodic/jfrThreadDumpEvent.hpp"
41 #include "jfr/periodic/jfrNetworkUtilization.hpp"
42 #include "jfr/recorder/jfrRecorder.hpp"
43 #include "jfr/support/jfrThreadId.hpp"
44 #include "jfr/utilities/jfrTime.hpp"
45 #include "jfrfiles/jfrPeriodic.hpp"
46 #include "logging/log.hpp"
47 #include "memory/heapInspection.hpp"
48 #include "memory/resourceArea.hpp"
49 #include "oops/oop.inline.hpp"
50 #include "runtime/arguments.hpp"
51 #include "runtime/flags/jvmFlag.hpp"
52 #include "runtime/globals.hpp"
53 #include "runtime/os.hpp"
54 #include "runtime/os_perf.hpp"
55 #include "runtime/thread.inline.hpp"
56 #include "runtime/threadSMR.hpp"
57 #include "runtime/sweeper.hpp"
58 #include "runtime/vmThread.hpp"
59 #include "services/classLoadingService.hpp"
60 #include "services/management.hpp"
61 #include "services/threadService.hpp"
62 #include "utilities/exceptions.hpp"
63 #include "utilities/globalDefinitions.hpp"
64
65 #if INCLUDE_G1GC
66 #include "gc/g1/g1HeapRegionEventSender.hpp"
67 #endif
68
69 /**
70 * JfrPeriodic class
71 * Implementation of declarations in
72 * xsl generated traceRequestables.hpp
73 */
74 #define TRACE_REQUEST_FUNC(id) void JfrPeriodicEventSet::request##id(void)
75
76 TRACE_REQUEST_FUNC(JVMInformation) {
77 ResourceMark rm;
78 EventJVMInformation event;
79 event.set_jvmName(VM_Version::vm_name());
80 event.set_jvmVersion(VM_Version::internal_vm_info_string());
81 event.set_javaArguments(Arguments::java_command());
82 event.set_jvmArguments(Arguments::jvm_args());
83 event.set_jvmFlags(Arguments::jvm_flags());
84 event.set_jvmStartTime(Management::vm_init_done_time());
85 event.commit();
86 }
87
88 TRACE_REQUEST_FUNC(OSInformation) {
297
298 TRACE_REQUEST_FUNC(StringFlag) {
299 SEND_FLAGS_OF_TYPE(StringFlag, ccstr);
300 }
301
302 class VM_GC_SendObjectCountEvent : public VM_GC_HeapInspection {
303 public:
304 VM_GC_SendObjectCountEvent() : VM_GC_HeapInspection(NULL, true) {}
305 virtual void doit() {
306 ObjectCountEventSender::enable_requestable_event();
307 collect();
308 ObjectCountEventSender::disable_requestable_event();
309 }
310 };
311
312 TRACE_REQUEST_FUNC(ObjectCount) {
313 VM_GC_SendObjectCountEvent op;
314 VMThread::execute(&op);
315 }
316
317 #if INCLUDE_G1GC
318 class VM_G1SendHeapRegionInfoEvents : public VM_Operation {
319 virtual void doit() {
320 G1HeapRegionEventSender::send_events();
321 }
322 virtual VMOp_Type type() const { return VMOp_HeapIterateOperation; }
323 };
324 #endif // INCLUDE_G1GC
325
326 TRACE_REQUEST_FUNC(G1HeapRegionInformation) {
327 #if INCLUDE_G1GC
328 if (UseG1GC) {
329 VM_G1SendHeapRegionInfoEvents op;
330 VMThread::execute(&op);
331 }
332 #endif // INCLUDE_G1GC
333 }
334
335 // Java Mission Control (JMC) uses (Java) Long.MIN_VALUE to describe that a
336 // long value is undefined.
337 static jlong jmc_undefined_long = min_jlong;
338
339 TRACE_REQUEST_FUNC(GCConfiguration) {
340 GCConfiguration conf;
341 jlong pause_target = conf.has_pause_target_default_value() ? jmc_undefined_long : conf.pause_target();
342 EventGCConfiguration event;
343 event.set_youngCollector(conf.young_collector());
344 event.set_oldCollector(conf.old_collector());
345 event.set_parallelGCThreads(conf.num_parallel_gc_threads());
346 event.set_concurrentGCThreads(conf.num_concurrent_gc_threads());
347 event.set_usesDynamicGCThreads(conf.uses_dynamic_gc_threads());
348 event.set_isExplicitGCConcurrent(conf.is_explicit_gc_concurrent());
349 event.set_isExplicitGCDisabled(conf.is_explicit_gc_disabled());
350 event.set_gcTimeRatio(conf.gc_time_ratio());
351 event.set_pauseTarget((s8)pause_target);
352 event.commit();
|