src/hotspot/share/jfr/periodic/jfrPeriodic.cpp
author coleenp
Fri, 28 Sep 2018 16:07:39 -0400
changeset 51959 db0c3952de52
parent 51698 74dde8b66b7f
child 52586 74109912c738
permissions -rw-r--r--
8209645: Split ClassLoaderData and ClassLoaderDataGraph into separate files Reviewed-by: iklam, stuefe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     1
/*
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     2
 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     4
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     7
 * published by the Free Software Foundation.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     8
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    13
 * accompanied this code).
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    14
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    18
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    21
 * questions.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    22
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    23
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    24
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    25
#include "precompiled.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    26
#include "jvm.h"
51959
db0c3952de52 8209645: Split ClassLoaderData and ClassLoaderDataGraph into separate files
coleenp
parents: 51698
diff changeset
    27
#include "classfile/classLoaderDataGraph.hpp"
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    28
#include "classfile/classLoaderStats.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    29
#include "classfile/javaClasses.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    30
#include "code/codeCache.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    31
#include "compiler/compileBroker.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    32
#include "gc/g1/g1HeapRegionEventSender.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    33
#include "gc/shared/gcConfiguration.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    34
#include "gc/shared/gcTrace.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    35
#include "gc/shared/objectCountEventSender.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    36
#include "gc/shared/vmGCOperations.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    37
#include "jfr/jfrEvents.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    38
#include "jfr/periodic/jfrModuleEvent.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    39
#include "jfr/periodic/jfrOSInterface.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    40
#include "jfr/periodic/jfrThreadCPULoadEvent.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    41
#include "jfr/periodic/jfrThreadDumpEvent.hpp"
50879
d90c3cbf13df 8003209: JFR events for network utilization
rwestberg
parents: 50113
diff changeset
    42
#include "jfr/periodic/jfrNetworkUtilization.hpp"
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    43
#include "jfr/recorder/jfrRecorder.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    44
#include "jfr/support/jfrThreadId.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    45
#include "jfr/utilities/jfrTime.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    46
#include "jfrfiles/jfrPeriodic.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    47
#include "logging/log.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    48
#include "memory/heapInspection.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    49
#include "memory/resourceArea.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    50
#include "oops/oop.inline.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    51
#include "runtime/arguments.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    52
#include "runtime/flags/jvmFlag.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    53
#include "runtime/globals.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    54
#include "runtime/os.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    55
#include "runtime/os_perf.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    56
#include "runtime/thread.inline.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    57
#include "runtime/threadSMR.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    58
#include "runtime/sweeper.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    59
#include "runtime/vmThread.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    60
#include "services/classLoadingService.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    61
#include "services/management.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    62
#include "services/threadService.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    63
#include "utilities/exceptions.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    64
#include "utilities/globalDefinitions.hpp"
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    65
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    66
/**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    67
 *  JfrPeriodic class
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    68
 *  Implementation of declarations in
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    69
 *  xsl generated traceRequestables.hpp
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    70
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    71
#define TRACE_REQUEST_FUNC(id)    void JfrPeriodicEventSet::request##id(void)
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    72
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    73
TRACE_REQUEST_FUNC(JVMInformation) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    74
  ResourceMark rm;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    75
  EventJVMInformation event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    76
  event.set_jvmName(VM_Version::vm_name());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    77
  event.set_jvmVersion(VM_Version::internal_vm_info_string());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    78
  event.set_javaArguments(Arguments::java_command());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    79
  event.set_jvmArguments(Arguments::jvm_args());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    80
  event.set_jvmFlags(Arguments::jvm_flags());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    81
  event.set_jvmStartTime(Management::vm_init_done_time());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    82
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    83
 }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    84
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    85
TRACE_REQUEST_FUNC(OSInformation) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    86
  ResourceMark rm;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    87
  char* os_name = NEW_RESOURCE_ARRAY(char, 2048);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    88
  JfrOSInterface::os_version(&os_name);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    89
  EventOSInformation event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    90
  event.set_osVersion(os_name);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    91
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    92
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    93
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    94
TRACE_REQUEST_FUNC(ModuleRequire) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    95
  JfrModuleEvent::generate_module_dependency_events();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    96
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    97
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    98
TRACE_REQUEST_FUNC(ModuleExport) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
    99
  JfrModuleEvent::generate_module_export_events();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   100
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   101
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   102
/*
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   103
 * This is left empty on purpose, having ExecutionSample as a requestable
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   104
 * is a way of getting the period. The period is passed to ThreadSampling::update_period.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   105
 * Implementation in jfrSamples.cpp
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   106
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   107
TRACE_REQUEST_FUNC(ExecutionSample) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   108
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   109
TRACE_REQUEST_FUNC(NativeMethodSample) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   110
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   111
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   112
TRACE_REQUEST_FUNC(ThreadDump) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   113
  ResourceMark rm;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   114
  EventThreadDump event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   115
  event.set_result(JfrDcmdEvent::thread_dump());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   116
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   117
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   118
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   119
static int _native_library_callback(const char* name, address base, address top, void *param) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   120
  EventNativeLibrary event(UNTIMED);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   121
  event.set_name(name);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   122
  event.set_baseAddress((u8)base);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   123
  event.set_topAddress((u8)top);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   124
  event.set_endtime(*(JfrTicks*) param);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   125
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   126
  return 0;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   127
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   128
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   129
TRACE_REQUEST_FUNC(NativeLibrary) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   130
  JfrTicks ts= JfrTicks::now();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   131
  os::get_loaded_modules_info(&_native_library_callback, (void *)&ts);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   132
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   133
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   134
TRACE_REQUEST_FUNC(InitialEnvironmentVariable) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   135
  JfrOSInterface::generate_initial_environment_variable_events();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   136
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   137
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   138
TRACE_REQUEST_FUNC(CPUInformation) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   139
  CPUInformation cpu_info;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   140
  int ret_val = JfrOSInterface::cpu_information(cpu_info);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   141
  if (ret_val == OS_ERR) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   142
    log_debug(jfr, system)( "Unable to generate requestable event CPUInformation");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   143
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   144
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   145
  if (ret_val == FUNCTIONALITY_NOT_IMPLEMENTED) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   146
     return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   147
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   148
  if (ret_val == OS_OK) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   149
    EventCPUInformation event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   150
    event.set_cpu(cpu_info.cpu_name());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   151
    event.set_description(cpu_info.cpu_description());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   152
    event.set_sockets(cpu_info.number_of_sockets());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   153
    event.set_cores(cpu_info.number_of_cores());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   154
    event.set_hwThreads(cpu_info.number_of_hardware_threads());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   155
    event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   156
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   157
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   158
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   159
TRACE_REQUEST_FUNC(CPULoad) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   160
  double u = 0; // user time
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   161
  double s = 0; // kernel time
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   162
  double t = 0; // total time
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   163
  int ret_val = JfrOSInterface::cpu_loads_process(&u, &s, &t);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   164
  if (ret_val == OS_ERR) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   165
    log_debug(jfr, system)( "Unable to generate requestable event CPULoad");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   166
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   167
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   168
  if (ret_val == OS_OK) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   169
    EventCPULoad event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   170
    event.set_jvmUser((float)u);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   171
    event.set_jvmSystem((float)s);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   172
    event.set_machineTotal((float)t);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   173
    event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   174
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   175
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   176
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   177
TRACE_REQUEST_FUNC(ThreadCPULoad) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   178
  JfrThreadCPULoadEvent::send_events();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   179
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   180
50879
d90c3cbf13df 8003209: JFR events for network utilization
rwestberg
parents: 50113
diff changeset
   181
TRACE_REQUEST_FUNC(NetworkUtilization) {
d90c3cbf13df 8003209: JFR events for network utilization
rwestberg
parents: 50113
diff changeset
   182
  JfrNetworkUtilization::send_events();
d90c3cbf13df 8003209: JFR events for network utilization
rwestberg
parents: 50113
diff changeset
   183
}
d90c3cbf13df 8003209: JFR events for network utilization
rwestberg
parents: 50113
diff changeset
   184
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   185
TRACE_REQUEST_FUNC(CPUTimeStampCounter) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   186
  EventCPUTimeStampCounter event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   187
  event.set_fastTimeEnabled(JfrTime::is_ft_enabled());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   188
  event.set_fastTimeAutoEnabled(JfrTime::is_ft_supported());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   189
  event.set_osFrequency(os::elapsed_frequency());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   190
  event.set_fastTimeFrequency(JfrTime::frequency());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   191
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   192
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   193
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   194
TRACE_REQUEST_FUNC(SystemProcess) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   195
  char pid_buf[16];
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   196
  SystemProcess* processes = NULL;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   197
  int num_of_processes = 0;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   198
  JfrTicks start_time = JfrTicks::now();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   199
  int ret_val = JfrOSInterface::system_processes(&processes, &num_of_processes);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   200
  if (ret_val == OS_ERR) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   201
    log_debug(jfr, system)( "Unable to generate requestable event SystemProcesses");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   202
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   203
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   204
  JfrTicks end_time = JfrTicks::now();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   205
  if (ret_val == FUNCTIONALITY_NOT_IMPLEMENTED) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   206
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   207
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   208
  if (ret_val == OS_OK) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   209
    // feature is implemented, write real event
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   210
    while (processes != NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   211
      SystemProcess* tmp = processes;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   212
      const char* info = processes->command_line();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   213
      if (info == NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   214
         info = processes->path();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   215
      }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   216
      if (info == NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   217
         info = processes->name();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   218
      }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   219
      if (info == NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   220
         info = "?";
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   221
      }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   222
      jio_snprintf(pid_buf, sizeof(pid_buf), "%d", processes->pid());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   223
      EventSystemProcess event(UNTIMED);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   224
      event.set_pid(pid_buf);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   225
      event.set_commandLine(info);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   226
      event.set_starttime(start_time);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   227
      event.set_endtime(end_time);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   228
      event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   229
      processes = processes->next();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   230
      delete tmp;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   231
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   232
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   233
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   234
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   235
TRACE_REQUEST_FUNC(ThreadContextSwitchRate) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   236
  double rate = 0.0;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   237
  int ret_val = JfrOSInterface::context_switch_rate(&rate);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   238
  if (ret_val == OS_ERR) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   239
    log_debug(jfr, system)( "Unable to generate requestable event ThreadContextSwitchRate");
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   240
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   241
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   242
  if (ret_val == FUNCTIONALITY_NOT_IMPLEMENTED) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   243
    return;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   244
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   245
  if (ret_val == OS_OK) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   246
    EventThreadContextSwitchRate event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   247
    event.set_switchRate((float)rate + 0.0f);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   248
    event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   249
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   250
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   251
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   252
#define SEND_FLAGS_OF_TYPE(eventType, flagType)                   \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   253
  do {                                                            \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   254
    JVMFlag *flag = JVMFlag::flags;                               \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   255
    while (flag->_name != NULL) {                                 \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   256
      if (flag->is_ ## flagType()) {                              \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   257
        if (flag->is_unlocked()) {                                \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   258
          Event ## eventType event;                               \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   259
          event.set_name(flag->_name);                            \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   260
          event.set_value(flag->get_ ## flagType());              \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   261
          event.set_origin(flag->get_origin());                   \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   262
          event.commit();                                         \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   263
        }                                                         \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   264
      }                                                           \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   265
      ++flag;                                                     \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   266
    }                                                             \
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   267
  } while (0)
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   268
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   269
TRACE_REQUEST_FUNC(IntFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   270
  SEND_FLAGS_OF_TYPE(IntFlag, int);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   271
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   272
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   273
TRACE_REQUEST_FUNC(UnsignedIntFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   274
  SEND_FLAGS_OF_TYPE(UnsignedIntFlag, uint);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   275
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   276
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   277
TRACE_REQUEST_FUNC(LongFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   278
  SEND_FLAGS_OF_TYPE(LongFlag, intx);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   279
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   280
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   281
TRACE_REQUEST_FUNC(UnsignedLongFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   282
  SEND_FLAGS_OF_TYPE(UnsignedLongFlag, uintx);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   283
  SEND_FLAGS_OF_TYPE(UnsignedLongFlag, uint64_t);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   284
  SEND_FLAGS_OF_TYPE(UnsignedLongFlag, size_t);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   285
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   286
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   287
TRACE_REQUEST_FUNC(DoubleFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   288
  SEND_FLAGS_OF_TYPE(DoubleFlag, double);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   289
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   290
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   291
TRACE_REQUEST_FUNC(BooleanFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   292
  SEND_FLAGS_OF_TYPE(BooleanFlag, bool);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   293
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   294
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   295
TRACE_REQUEST_FUNC(StringFlag) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   296
  SEND_FLAGS_OF_TYPE(StringFlag, ccstr);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   297
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   298
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   299
class VM_GC_SendObjectCountEvent : public VM_GC_HeapInspection {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   300
 public:
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   301
  VM_GC_SendObjectCountEvent() : VM_GC_HeapInspection(NULL, true) {}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   302
  virtual void doit() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   303
    ObjectCountEventSender::enable_requestable_event();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   304
    collect();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   305
    ObjectCountEventSender::disable_requestable_event();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   306
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   307
};
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   308
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   309
TRACE_REQUEST_FUNC(ObjectCount) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   310
  VM_GC_SendObjectCountEvent op;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   311
  VMThread::execute(&op);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   312
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   313
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   314
class VM_G1SendHeapRegionInfoEvents : public VM_Operation {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   315
  virtual void doit() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   316
    G1HeapRegionEventSender::send_events();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   317
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   318
  virtual VMOp_Type type() const { return VMOp_HeapIterateOperation; }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   319
};
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   320
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   321
TRACE_REQUEST_FUNC(G1HeapRegionInformation) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   322
  if (UseG1GC) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   323
    VM_G1SendHeapRegionInfoEvents op;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   324
    VMThread::execute(&op);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   325
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   326
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   327
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   328
// Java Mission Control (JMC) uses (Java) Long.MIN_VALUE to describe that a
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   329
// long value is undefined.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   330
static jlong jmc_undefined_long = min_jlong;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   331
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   332
TRACE_REQUEST_FUNC(GCConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   333
  GCConfiguration conf;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   334
  jlong pause_target = conf.has_pause_target_default_value() ? jmc_undefined_long : conf.pause_target();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   335
  EventGCConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   336
  event.set_youngCollector(conf.young_collector());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   337
  event.set_oldCollector(conf.old_collector());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   338
  event.set_parallelGCThreads(conf.num_parallel_gc_threads());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   339
  event.set_concurrentGCThreads(conf.num_concurrent_gc_threads());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   340
  event.set_usesDynamicGCThreads(conf.uses_dynamic_gc_threads());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   341
  event.set_isExplicitGCConcurrent(conf.is_explicit_gc_concurrent());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   342
  event.set_isExplicitGCDisabled(conf.is_explicit_gc_disabled());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   343
  event.set_gcTimeRatio(conf.gc_time_ratio());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   344
  event.set_pauseTarget((s8)pause_target);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   345
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   346
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   347
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   348
TRACE_REQUEST_FUNC(GCTLABConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   349
  GCTLABConfiguration conf;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   350
  EventGCTLABConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   351
  event.set_usesTLABs(conf.uses_tlabs());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   352
  event.set_minTLABSize(conf.min_tlab_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   353
  event.set_tlabRefillWasteLimit(conf.tlab_refill_waste_limit());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   354
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   355
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   356
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   357
TRACE_REQUEST_FUNC(GCSurvivorConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   358
  GCSurvivorConfiguration conf;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   359
  EventGCSurvivorConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   360
  event.set_maxTenuringThreshold(conf.max_tenuring_threshold());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   361
  event.set_initialTenuringThreshold(conf.initial_tenuring_threshold());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   362
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   363
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   364
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   365
TRACE_REQUEST_FUNC(GCHeapConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   366
  GCHeapConfiguration conf;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   367
  EventGCHeapConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   368
  event.set_minSize(conf.min_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   369
  event.set_maxSize(conf.max_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   370
  event.set_initialSize(conf.initial_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   371
  event.set_usesCompressedOops(conf.uses_compressed_oops());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   372
  event.set_compressedOopsMode(conf.narrow_oop_mode());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   373
  event.set_objectAlignment(conf.object_alignment_in_bytes());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   374
  event.set_heapAddressBits(conf.heap_address_size_in_bits());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   375
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   376
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   377
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   378
TRACE_REQUEST_FUNC(YoungGenerationConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   379
  GCYoungGenerationConfiguration conf;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   380
  jlong max_size = conf.has_max_size_default_value() ? jmc_undefined_long : conf.max_size();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   381
  EventYoungGenerationConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   382
  event.set_maxSize((u8)max_size);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   383
  event.set_minSize(conf.min_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   384
  event.set_newRatio(conf.new_ratio());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   385
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   386
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   387
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   388
TRACE_REQUEST_FUNC(InitialSystemProperty) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   389
  SystemProperty* p = Arguments::system_properties();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   390
  JfrTicks time_stamp = JfrTicks::now();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   391
  while (p !=  NULL) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   392
    if (!p->internal()) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   393
      EventInitialSystemProperty event(UNTIMED);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   394
      event.set_key(p->key());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   395
      event.set_value(p->value());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   396
      event.set_endtime(time_stamp);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   397
      event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   398
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   399
    p = p->next();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   400
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   401
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   402
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   403
TRACE_REQUEST_FUNC(ThreadAllocationStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   404
  ResourceMark rm;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   405
  int initial_size = Threads::number_of_threads();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   406
  GrowableArray<jlong> allocated(initial_size);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   407
  GrowableArray<traceid> thread_ids(initial_size);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   408
  JfrTicks time_stamp = JfrTicks::now();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   409
  {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   410
    // Collect allocation statistics while holding threads lock
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   411
    MutexLockerEx ml(Threads_lock);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   412
    for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   413
      allocated.append(jt->cooked_allocated_bytes());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   414
      thread_ids.append(JFR_THREAD_ID(jt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   415
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   416
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   417
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   418
  // Write allocation statistics to buffer.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   419
  for(int i = 0; i < thread_ids.length(); i++) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   420
    EventThreadAllocationStatistics event(UNTIMED);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   421
    event.set_allocated(allocated.at(i));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   422
    event.set_thread(thread_ids.at(i));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   423
    event.set_endtime(time_stamp);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   424
    event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   425
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   426
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   427
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   428
/**
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   429
 *  PhysicalMemory event represents:
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   430
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   431
 *  @totalSize == The amount of physical memory (hw) installed and reported by the OS, in bytes.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   432
 *  @usedSize  == The amount of physical memory currently in use in the system (reserved/committed), in bytes.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   433
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   434
 *  Both fields are systemwide, i.e. represents the entire OS/HW environment.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   435
 *  These fields do not include virtual memory.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   436
 *
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   437
 *  If running inside a guest OS on top of a hypervisor in a virtualized environment,
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   438
 *  the total memory reported is the amount of memory configured for the guest OS by the hypervisor.
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   439
 */
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   440
TRACE_REQUEST_FUNC(PhysicalMemory) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   441
  u8 totalPhysicalMemory = os::physical_memory();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   442
  EventPhysicalMemory event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   443
  event.set_totalSize(totalPhysicalMemory);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   444
  event.set_usedSize(totalPhysicalMemory - os::available_memory());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   445
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   446
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   447
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   448
TRACE_REQUEST_FUNC(JavaThreadStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   449
  EventJavaThreadStatistics event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   450
  event.set_activeCount(ThreadService::get_live_thread_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   451
  event.set_daemonCount(ThreadService::get_daemon_thread_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   452
  event.set_accumulatedCount(ThreadService::get_total_thread_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   453
  event.set_peakCount(ThreadService::get_peak_thread_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   454
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   455
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   456
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   457
TRACE_REQUEST_FUNC(ClassLoadingStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   458
  EventClassLoadingStatistics event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   459
  event.set_loadedClassCount(ClassLoadingService::loaded_class_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   460
  event.set_unloadedClassCount(ClassLoadingService::unloaded_class_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   461
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   462
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   463
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   464
class JfrClassLoaderStatsClosure : public ClassLoaderStatsClosure {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   465
public:
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   466
  JfrClassLoaderStatsClosure() : ClassLoaderStatsClosure(NULL) {}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   467
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   468
  bool do_entry(oop const& key, ClassLoaderStats* const& cls) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   469
    const ClassLoaderData* this_cld = cls->_class_loader != NULL ?
51698
74dde8b66b7f 8210422: runtime/modules/ModuleStress/ExportModuleStressTest.java - assertion failed: address not aligned: 0x00000008baadbabe
coleenp
parents: 51444
diff changeset
   470
      java_lang_ClassLoader::loader_data_acquire(cls->_class_loader) : NULL;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   471
    const ClassLoaderData* parent_cld = cls->_parent != NULL ?
51698
74dde8b66b7f 8210422: runtime/modules/ModuleStress/ExportModuleStressTest.java - assertion failed: address not aligned: 0x00000008baadbabe
coleenp
parents: 51444
diff changeset
   472
      java_lang_ClassLoader::loader_data_acquire(cls->_parent) : NULL;
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   473
    EventClassLoaderStatistics event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   474
    event.set_classLoader(this_cld);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   475
    event.set_parentClassLoader(parent_cld);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   476
    event.set_classLoaderData((intptr_t)cls->_cld);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   477
    event.set_classCount(cls->_classes_count);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   478
    event.set_chunkSize(cls->_chunk_sz);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   479
    event.set_blockSize(cls->_block_sz);
51444
3e5d28e6de32 8209301: JVM rename is_anonymous, host_klass to unsafe specific terminology ahead of Unsafe.defineAnonymousClass deprecation
lfoltan
parents: 50879
diff changeset
   480
    event.set_unsafeAnonymousClassCount(cls->_anon_classes_count);
3e5d28e6de32 8209301: JVM rename is_anonymous, host_klass to unsafe specific terminology ahead of Unsafe.defineAnonymousClass deprecation
lfoltan
parents: 50879
diff changeset
   481
    event.set_unsafeAnonymousChunkSize(cls->_anon_chunk_sz);
3e5d28e6de32 8209301: JVM rename is_anonymous, host_klass to unsafe specific terminology ahead of Unsafe.defineAnonymousClass deprecation
lfoltan
parents: 50879
diff changeset
   482
    event.set_unsafeAnonymousBlockSize(cls->_anon_block_sz);
50113
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   483
    event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   484
    return true;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   485
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   486
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   487
  void createEvents(void) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   488
    _stats->iterate(this);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   489
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   490
};
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   491
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   492
class JfrClassLoaderStatsVMOperation : public ClassLoaderStatsVMOperation {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   493
 public:
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   494
  JfrClassLoaderStatsVMOperation() : ClassLoaderStatsVMOperation(NULL) { }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   495
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   496
  void doit() {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   497
    JfrClassLoaderStatsClosure clsc;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   498
    ClassLoaderDataGraph::cld_do(&clsc);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   499
    clsc.createEvents();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   500
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   501
};
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   502
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   503
TRACE_REQUEST_FUNC(ClassLoaderStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   504
  JfrClassLoaderStatsVMOperation op;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   505
  VMThread::execute(&op);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   506
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   507
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   508
TRACE_REQUEST_FUNC(CompilerStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   509
  EventCompilerStatistics event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   510
  event.set_compileCount(CompileBroker::get_total_compile_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   511
  event.set_bailoutCount(CompileBroker::get_total_bailout_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   512
  event.set_invalidatedCount(CompileBroker::get_total_invalidated_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   513
  event.set_osrCompileCount(CompileBroker::get_total_osr_compile_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   514
  event.set_standardCompileCount(CompileBroker::get_total_standard_compile_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   515
  event.set_osrBytesCompiled(CompileBroker::get_sum_osr_bytes_compiled());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   516
  event.set_standardBytesCompiled(CompileBroker::get_sum_standard_bytes_compiled());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   517
  event.set_nmetodsSize(CompileBroker::get_sum_nmethod_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   518
  event.set_nmetodCodeSize(CompileBroker::get_sum_nmethod_code_size());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   519
  event.set_peakTimeSpent(CompileBroker::get_peak_compilation_time());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   520
  event.set_totalTimeSpent(CompileBroker::get_total_compilation_time());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   521
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   522
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   523
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   524
TRACE_REQUEST_FUNC(CompilerConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   525
  EventCompilerConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   526
  event.set_threadCount(CICompilerCount);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   527
  event.set_tieredCompilation(TieredCompilation);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   528
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   529
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   530
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   531
TRACE_REQUEST_FUNC(CodeCacheStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   532
  // Emit stats for all available code heaps
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   533
  for (int bt = 0; bt < CodeBlobType::NumTypes; ++bt) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   534
    if (CodeCache::heap_available(bt)) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   535
      EventCodeCacheStatistics event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   536
      event.set_codeBlobType((u1)bt);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   537
      event.set_startAddress((u8)CodeCache::low_bound(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   538
      event.set_reservedTopAddress((u8)CodeCache::high_bound(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   539
      event.set_entryCount(CodeCache::blob_count(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   540
      event.set_methodCount(CodeCache::nmethod_count(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   541
      event.set_adaptorCount(CodeCache::adapter_count(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   542
      event.set_unallocatedCapacity(CodeCache::unallocated_capacity(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   543
      event.set_fullCount(CodeCache::get_codemem_full_count(bt));
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   544
      event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   545
    }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   546
  }
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   547
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   548
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   549
TRACE_REQUEST_FUNC(CodeCacheConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   550
  EventCodeCacheConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   551
  event.set_initialSize(InitialCodeCacheSize);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   552
  event.set_reservedSize(ReservedCodeCacheSize);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   553
  event.set_nonNMethodSize(NonNMethodCodeHeapSize);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   554
  event.set_profiledSize(ProfiledCodeHeapSize);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   555
  event.set_nonProfiledSize(NonProfiledCodeHeapSize);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   556
  event.set_expansionSize(CodeCacheExpansionSize);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   557
  event.set_minBlockLength(CodeCacheMinBlockLength);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   558
  event.set_startAddress((u8)CodeCache::low_bound());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   559
  event.set_reservedTopAddress((u8)CodeCache::high_bound());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   560
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   561
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   562
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   563
TRACE_REQUEST_FUNC(CodeSweeperStatistics) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   564
  EventCodeSweeperStatistics event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   565
  event.set_sweepCount(NMethodSweeper::traversal_count());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   566
  event.set_methodReclaimedCount(NMethodSweeper::total_nof_methods_reclaimed());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   567
  event.set_totalSweepTime(NMethodSweeper::total_time_sweeping());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   568
  event.set_peakFractionTime(NMethodSweeper::peak_sweep_fraction_time());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   569
  event.set_peakSweepTime(NMethodSweeper::peak_sweep_time());
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   570
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   571
}
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   572
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   573
TRACE_REQUEST_FUNC(CodeSweeperConfiguration) {
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   574
  EventCodeSweeperConfiguration event;
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   575
  event.set_sweeperEnabled(MethodFlushing);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   576
  event.set_flushingEnabled(UseCodeCacheFlushing);
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   577
  event.commit();
caf115bb98ad 8199712: Flight Recorder
egahlin
parents:
diff changeset
   578
}