Wed, 16 May 2018 15:25:51 +0200
8203287: Zero fails to build after JDK-8199712 (Flight Recorder)
Reviewed-by: shade, mdoerr
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/cpu/zero/vm/vm_version_ext_zero.cpp Wed May 16 15:25:51 2018 +0200 1.3 @@ -0,0 +1,82 @@ 1.4 +/* 1.5 + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#include "memory/allocation.hpp" 1.29 +#include "memory/allocation.inline.hpp" 1.30 +#include "runtime/os.hpp" 1.31 +#include "vm_version_ext_zero.hpp" 1.32 + 1.33 +// VM_Version_Ext statics 1.34 +int VM_Version_Ext::_no_of_threads = 0; 1.35 +int VM_Version_Ext::_no_of_cores = 0; 1.36 +int VM_Version_Ext::_no_of_sockets = 0; 1.37 +bool VM_Version_Ext::_initialized = false; 1.38 +char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0}; 1.39 + 1.40 +void VM_Version_Ext::initialize_cpu_information(void) { 1.41 + // do nothing if cpu info has been initialized 1.42 + if (_initialized) { 1.43 + return; 1.44 + } 1.45 + 1.46 + int core_id = -1; 1.47 + int chip_id = -1; 1.48 + int len = 0; 1.49 + char* src_string = NULL; 1.50 + 1.51 + _no_of_cores = os::processor_count(); 1.52 + _no_of_threads = _no_of_cores; 1.53 + _no_of_sockets = _no_of_cores; 1.54 + snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "Zero VM"); 1.55 + _initialized = true; 1.56 +} 1.57 + 1.58 +int VM_Version_Ext::number_of_threads(void) { 1.59 + initialize_cpu_information(); 1.60 + return _no_of_threads; 1.61 +} 1.62 + 1.63 +int VM_Version_Ext::number_of_cores(void) { 1.64 + initialize_cpu_information(); 1.65 + return _no_of_cores; 1.66 +} 1.67 + 1.68 +int VM_Version_Ext::number_of_sockets(void) { 1.69 + initialize_cpu_information(); 1.70 + return _no_of_sockets; 1.71 +} 1.72 + 1.73 +const char* VM_Version_Ext::cpu_name(void) { 1.74 + initialize_cpu_information(); 1.75 + char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing); 1.76 + if (NULL == tmp) { 1.77 + return NULL; 1.78 + } 1.79 + strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE); 1.80 + return tmp; 1.81 +} 1.82 + 1.83 +const char* VM_Version_Ext::cpu_description(void) { 1.84 + return ""; 1.85 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/src/cpu/zero/vm/vm_version_ext_zero.hpp Wed May 16 15:25:51 2018 +0200 2.3 @@ -0,0 +1,52 @@ 2.4 +/* 2.5 + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. 2.11 + * 2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.15 + * version 2 for more details (a copy is included in the LICENSE file that 2.16 + * accompanied this code). 2.17 + * 2.18 + * You should have received a copy of the GNU General Public License version 2.19 + * 2 along with this work; if not, write to the Free Software Foundation, 2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.21 + * 2.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.23 + * or visit www.oracle.com if you need additional information or have any 2.24 + * questions. 2.25 + * 2.26 + */ 2.27 + 2.28 +#ifndef CPU_ZERO_VM_VM_VERSION_EXT_ZERO_HPP 2.29 +#define CPU_ZERO_VM_VM_VERSION_EXT_ZERO_HPP 2.30 + 2.31 +#include "utilities/macros.hpp" 2.32 +#include "vm_version_zero.hpp" 2.33 + 2.34 +class VM_Version_Ext : public VM_Version { 2.35 + private: 2.36 + static const size_t CPU_TYPE_DESC_BUF_SIZE = 256; 2.37 + 2.38 + static int _no_of_threads; 2.39 + static int _no_of_cores; 2.40 + static int _no_of_sockets; 2.41 + static bool _initialized; 2.42 + static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE]; 2.43 + 2.44 + public: 2.45 + static int number_of_threads(void); 2.46 + static int number_of_cores(void); 2.47 + static int number_of_sockets(void); 2.48 + 2.49 + static const char* cpu_name(void); 2.50 + static const char* cpu_description(void); 2.51 + static void initialize_cpu_information(void); 2.52 + 2.53 +}; 2.54 + 2.55 +#endif // CPU_ZERO_VM_VM_VERSION_EXT_ZERO_HPP
3.1 --- a/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp Thu Aug 15 13:28:03 2019 +0300 3.2 +++ b/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp Wed May 16 15:25:51 2018 +0200 3.3 @@ -112,6 +112,14 @@ 3.4 ShouldNotCallThis(); 3.5 } 3.6 3.7 + bool pd_get_top_frame_for_profiling(frame* fr_addr, 3.8 + void* ucontext, 3.9 + bool isInJava) { 3.10 + ShouldNotCallThis(); 3.11 + return false; // silence compile warning 3.12 + } 3.13 + 3.14 + 3.15 // These routines are only used on cpu architectures that 3.16 // have separate register stacks (Itanium). 3.17 static bool register_stack_overflow() { return false; }
4.1 --- a/src/share/vm/utilities/ticks.cpp Thu Aug 15 13:28:03 2019 +0300 4.2 +++ b/src/share/vm/utilities/ticks.cpp Wed May 16 15:25:51 2018 +0200 4.3 @@ -26,7 +26,7 @@ 4.4 #include "runtime/os.hpp" 4.5 #include "utilities/ticks.hpp" 4.6 4.7 -#ifdef X86 4.8 +#if defined(X86) && !defined(ZERO) 4.9 #include "rdtsc_x86.hpp" 4.10 #endif 4.11 4.12 @@ -61,7 +61,7 @@ 4.13 } 4.14 4.15 uint64_t FastUnorderedElapsedCounterSource::frequency() { 4.16 -#ifdef X86 4.17 +#if defined(X86) && !defined(ZERO) 4.18 static bool valid_rdtsc = Rdtsc::initialize(); 4.19 if (valid_rdtsc) { 4.20 static const uint64_t freq = (uint64_t)Rdtsc::frequency(); 4.21 @@ -73,7 +73,7 @@ 4.22 } 4.23 4.24 FastUnorderedElapsedCounterSource::Type FastUnorderedElapsedCounterSource::now() { 4.25 -#ifdef X86 4.26 +#if defined(X86) && !defined(ZERO) 4.27 static bool valid_rdtsc = Rdtsc::initialize(); 4.28 if (valid_rdtsc) { 4.29 return Rdtsc::elapsed_counter(); 4.30 @@ -105,7 +105,7 @@ 4.31 CompositeElapsedCounterSource::Type CompositeElapsedCounterSource::now() { 4.32 CompositeTime ct; 4.33 ct.val1 = ElapsedCounterSource::now(); 4.34 -#ifdef X86 4.35 +#if defined(X86) && !defined(ZERO) 4.36 static bool initialized = false; 4.37 static bool valid_rdtsc = false; 4.38 if (!initialized) {