8203288: PPC64 and s390 fail to build after JDK-8199712 (Flight Recorder)

Reviewed-by: shade
This commit is contained in:
Martin Doerr 2018-05-17 14:16:49 +02:00
parent 9a0a01d53b
commit 2dd143b06f
14 changed files with 1370 additions and 12 deletions

View file

@ -0,0 +1,80 @@
/*
* Copyright (c) 2013, 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 "jvm.h"
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
#include "vm_version_ext_ppc.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;
char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
// get cpu information.
bool VM_Version_Ext::initialize_cpu_information(void) {
// Not yet implemented.
return false;
}
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) {
if (!initialize_cpu_information()) {
return NULL;
}
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) {
if (!initialize_cpu_information()) {
return NULL;
}
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;
}

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2013, 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_PPC_VM_VM_VERSION_EXT_PPC_HPP
#define CPU_PPC_VM_VM_VERSION_EXT_PPC_HPP
#include "utilities/macros.hpp"
#include "vm_version_ppc.hpp"
#define CPU_INFO "cpu_info"
#define CPU_TYPE "fpu_type"
#define CPU_DESCRIPTION "implementation"
#define CHIP_ID "chip_id"
#define CORE_ID "core_id"
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 char _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
static bool initialize_cpu_information(void);
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);
};
#endif // CPU_PPC_VM_VM_VERSION_EXT_PPC_HPP

View file

@ -0,0 +1,80 @@
/*
* Copyright (c) 2013, 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 "jvm.h"
#include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp"
#include "vm_version_ext_s390.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;
char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
// get cpu information.
bool VM_Version_Ext::initialize_cpu_information(void) {
// Not yet implemented.
return false;
}
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) {
if (!initialize_cpu_information()) {
return NULL;
}
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) {
if (!initialize_cpu_information()) {
return NULL;
}
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;
}

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2013, 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_S390_VM_VM_VERSION_EXT_S390_HPP
#define CPU_S390_VM_VM_VERSION_EXT_S390_HPP
#include "utilities/macros.hpp"
#include "vm_version_s390.hpp"
#define CPU_INFO "cpu_info"
#define CPU_TYPE "fpu_type"
#define CPU_DESCRIPTION "implementation"
#define CHIP_ID "chip_id"
#define CORE_ID "core_id"
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 char _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
static bool initialize_cpu_information(void);
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);
};
#endif // CPU_S390_VM_VM_VERSION_EXT_S390_HPP

View file

@ -1377,6 +1377,21 @@ void os::get_summary_os_info(char* buf, size_t buflen) {
snprintf(buf, buflen, "%s %s", name.release, name.version);
}
int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *param) {
// Not yet implemented.
return 0;
}
void os::print_os_info_brief(outputStream* st) {
uint32_t ver = os::Aix::os_version();
st->print_cr("AIX kernel version %u.%u.%u.%u",
(ver >> 24) & 0xFF, (ver >> 16) & 0xFF, (ver >> 8) & 0xFF, ver & 0xFF);
os::Posix::print_uname_info(st);
// Linux uses print_libversion_info(st); here.
}
void os::print_os_info(outputStream* st) {
st->print("OS:");

File diff suppressed because it is too large Load diff

View file

@ -29,17 +29,7 @@
#include "runtime/os.hpp"
#include "runtime/os_perf.hpp"
#ifdef X86
#include "vm_version_ext_x86.hpp"
#endif
#ifdef ARM
#include "vm_version_ext_arm.hpp"
#endif
#ifndef ARM
#ifdef AARCH64
#include "vm_version_ext_aarch64.hpp"
#endif
#endif
#include CPU_HEADER(vm_version_ext)
#include <stdio.h>
#include <stdarg.h>

View file

@ -40,6 +40,13 @@ frame JavaThread::pd_last_frame() {
return frame(sp, pc);
}
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
*fr_addr = frame((intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.jmp_context.iar);
return true;
}
// Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Aix/PPC.
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
Unimplemented();

View file

@ -48,4 +48,7 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
bool isInJava);
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
bool isInJava);
#endif // OS_CPU_AIX_PPC_VM_THREAD_AIX_PPC_HPP

View file

@ -41,6 +41,13 @@ frame JavaThread::pd_last_frame() {
return frame(sp, pc);
}
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
*fr_addr = frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
(address)uc->uc_mcontext.regs->nip);
return true;
}
// Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/PPC.
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
Unimplemented();

View file

@ -49,4 +49,6 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
#endif // OS_CPU_LINUX_PPC_VM_THREAD_LINUX_PPC_HPP

View file

@ -41,6 +41,13 @@ frame JavaThread::pd_last_frame() {
return frame(sp, pc);
}
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
ucontext_t* uc = (ucontext_t*) ucontext;
*fr_addr = frame((intptr_t*)uc->uc_mcontext.gregs[15/*REG_SP*/],
(address)uc->uc_mcontext.psw.addr);
return true;
}
// Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/S390x.
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
Unimplemented();

View file

@ -48,4 +48,6 @@
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
#endif // OS_CPU_LINUX_S390_VM_THREAD_LINUX_S390_HPP

View file

@ -100,7 +100,7 @@ inline T JfrBigEndian::read_unaligned(const address location) {
}
inline bool JfrBigEndian::platform_supports_unaligned_reads(void) {
#if defined(IA32) || defined(AMD64)
#if defined(IA32) || defined(AMD64) || defined(PPC) || defined(S390)
return true;
#elif defined(SPARC) || defined(ARM) || defined(AARCH64)
return false;