--- old/src/os/linux/vm/os_perf_linux.cpp 2019-02-08 20:30:01.546010675 +0300 +++ new/src/os/linux/vm/os_perf_linux.cpp 2019-02-08 20:30:01.498012267 +0300 @@ -29,9 +29,6 @@ #include "runtime/os.hpp" #include "runtime/os_perf.hpp" -#ifdef TARGET_ARCH_aarch32 -# include "vm_version_ext_aarch32.hpp" -#endif #ifdef TARGET_ARCH_x86 # include "vm_version_ext_x86.hpp" #endif @@ -47,6 +44,9 @@ #ifdef TARGET_ARCH_ppc # include "vm_version_ext_ppc.hpp" #endif +#ifdef TARGET_ARCH_aarch64 +# include "vm_version_ext_aarch64.hpp" +#endif #include #include --- old/src/share/vm/gc_implementation/shenandoah/shenandoahGCTraceTime.cpp 2019-02-08 20:30:01.642007488 +0300 +++ new/src/share/vm/gc_implementation/shenandoah/shenandoahGCTraceTime.cpp 2019-02-08 20:30:01.598008948 +0300 @@ -33,7 +33,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/timer.hpp" #include "utilities/ostream.hpp" -#include "utilities/ticks.inline.hpp" +#include "utilities/ticks.hpp" ShenandoahGCTraceTime::ShenandoahGCTraceTime(const char* title, bool doit, GCTimer* timer, GCId gc_id, bool print_heap) : @@ -72,7 +72,7 @@ if (_doit) { const Tickspan duration = stop_counter - _start_counter; - double secs = TicksToTimeHelper::seconds(duration); + double secs = duration.seconds(); size_t bytes_after = _heap->used(); size_t capacity = _heap->capacity(); --- old/src/share/vm/jfr/utilities/jfrBigEndian.hpp 2019-02-08 20:30:01.738004303 +0300 +++ new/src/share/vm/jfr/utilities/jfrBigEndian.hpp 2019-02-08 20:30:01.694005763 +0300 @@ -42,6 +42,9 @@ #ifdef TARGET_ARCH_ppc # include "bytes_ppc.hpp" #endif +#ifdef TARGET_ARCH_aarch64 +# include "bytes_aarch64.hpp" +#endif #ifndef VM_LITTLE_ENDIAN # define bigendian_16(x) (x) --- old/src/share/vm/jfr/writers/jfrEncoders.hpp 2019-02-08 20:30:01.838000984 +0300 +++ new/src/share/vm/jfr/writers/jfrEncoders.hpp 2019-02-08 20:30:01.786002710 +0300 @@ -43,6 +43,9 @@ #ifdef TARGET_ARCH_ppc # include "bytes_ppc.hpp" #endif +#ifdef TARGET_ARCH_aarch64 +# include "bytes_aarch64.hpp" +#endif // // The Encoding policy prescribes a template --- /dev/null 2019-02-07 20:54:51.336000000 +0300 +++ new/src/cpu/aarch64/vm/vm_version_ext_aarch64.cpp 2019-02-08 20:30:01.877999658 +0300 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "memory/allocation.hpp" +#include "memory/allocation.inline.hpp" +#include "runtime/os.hpp" +#include "vm_version_ext_aarch64.hpp" + +// VM_Version_Ext statics +int VM_Version_Ext::_no_of_threads = 0; +int VM_Version_Ext::_no_of_cores = 0; +int VM_Version_Ext::_no_of_sockets = 0; +bool VM_Version_Ext::_initialized = false; +char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0}; +char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0}; + +void VM_Version_Ext::initialize_cpu_information(void) { + // do nothing if cpu info has been initialized + if (_initialized) { + return; + } + + int core_id = -1; + int chip_id = -1; + int len = 0; + char* src_string = NULL; + + _no_of_cores = os::processor_count(); + _no_of_threads = _no_of_cores; + _no_of_sockets = _no_of_cores; + snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "AArch64"); + snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_str); + _initialized = true; +} + +int VM_Version_Ext::number_of_threads(void) { + initialize_cpu_information(); + return _no_of_threads; +} + +int VM_Version_Ext::number_of_cores(void) { + initialize_cpu_information(); + return _no_of_cores; +} + +int VM_Version_Ext::number_of_sockets(void) { + initialize_cpu_information(); + return _no_of_sockets; +} + +const char* VM_Version_Ext::cpu_name(void) { + initialize_cpu_information(); + char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing); + if (NULL == tmp) { + return NULL; + } + strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE); + return tmp; +} + +const char* VM_Version_Ext::cpu_description(void) { + initialize_cpu_information(); + char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing); + if (NULL == tmp) { + return NULL; + } + strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE); + return tmp; +} --- /dev/null 2019-02-07 20:54:51.336000000 +0300 +++ new/src/cpu/aarch64/vm/vm_version_ext_aarch64.hpp 2019-02-08 20:30:01.957997002 +0300 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_AARCH64_VM_VM_VERSION_EXT_AARCH64_HPP +#define CPU_AARCH64_VM_VM_VERSION_EXT_AARCH64_HPP + +#include "utilities/macros.hpp" +#include "vm_version_aarch64.hpp" + +class VM_Version_Ext : public VM_Version { + private: + static const size_t CPU_TYPE_DESC_BUF_SIZE = 256; + static const size_t CPU_DETAILED_DESC_BUF_SIZE = 4096; + + static int _no_of_threads; + static int _no_of_cores; + static int _no_of_sockets; + static bool _initialized; + static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE]; + static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE]; + + public: + static int number_of_threads(void); + static int number_of_cores(void); + static int number_of_sockets(void); + + static const char* cpu_name(void); + static const char* cpu_description(void); + static void initialize_cpu_information(void); + +}; + +#endif // CPU_AARCH64_VM_VM_VERSION_EXT_AARCH64_HPP