< prev index next >

src/share/vm/runtime/vm_version.hpp

Print this page
rev 9054 : 8219241: Provide basic virtualization related info in the hs_error file on linux/windows x86_64
Reviewed-by: dholmes, mdoerr
rev 9055 : 8223438: add VirtualizationInformation JFR event
Reviewed-by: clanger, egahlin

@@ -26,10 +26,21 @@
 #define SHARE_VM_RUNTIME_VM_VERSION_HPP
 
 #include "memory/allocation.hpp"
 #include "utilities/ostream.hpp"
 
+typedef enum {
+  NoDetectedVirtualization,
+  XenHVM,
+  KVM,
+  VMWare,
+  HyperV,
+  PowerVM, // on AIX or Linux ppc64(le)
+  PowerFullPartitionMode, // on Linux ppc64(le)
+  PowerKVM
+} VirtualizationType;
+
 // VM_Version provides information about the VM.
 
 class Abstract_VM_Version: AllStatic {
  protected:
   friend class VMStructs;

@@ -52,11 +63,13 @@
   static int          _reserve_for_allocation_prefetch;
 
   static unsigned int nof_parallel_worker_threads(unsigned int num,
                                                   unsigned int dem,
                                                   unsigned int switch_pt);
- public:
+  static VirtualizationType _detected_virtualization;
+
+public:
   // Called as part of the runtime services initialization which is
   // called from the management module initialization (via init_globals())
   // after argument parsing and attaching of the main thread has
   // occurred.  Examines a variety of the hardware capabilities of
   // the platform to determine which features can be used to execute the

@@ -94,10 +107,18 @@
 
   // Internal version providing additional build information
   static const char* internal_vm_info_string();
   static const char* jre_release_version();
 
+  static VirtualizationType get_detected_virtualization() {
+    return _detected_virtualization;
+  }
+
+  // platforms that need to specialize this
+  // define VM_Version::print_platform_virtualization_info()
+  static void print_platform_virtualization_info(outputStream*) { }
+
   // does HW support an 8-byte compare-exchange operation?
   static bool supports_cx8()  {
     assert(_initialized, "not initialized");
 #ifdef SUPPORTS_NATIVE_CX8
     return true;

@@ -141,8 +162,10 @@
   // command line.
   static unsigned int parallel_worker_threads();
   // Calculates and returns the number of parallel threads.  May
   // be VM version specific.
   static unsigned int calc_parallel_worker_threads();
+
+  static bool print_matching_lines_from_file(const char* filename, outputStream* st, const char* keywords_to_match[]);
 };
 
 #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
< prev index next >