8203301: Linux-sparc fails to build after JDK-8199712 (Flight Recorder)

Reviewed-by: kvn, thartmann
This commit is contained in:
John Paul Adrian Glaubitz 2018-06-13 10:34:51 +02:00
parent cc206eaca5
commit c2265fb70b
4 changed files with 25 additions and 2 deletions

View file

@ -31,10 +31,13 @@
int VM_Version_Ext::_no_of_threads = 0; int VM_Version_Ext::_no_of_threads = 0;
int VM_Version_Ext::_no_of_cores = 0; int VM_Version_Ext::_no_of_cores = 0;
int VM_Version_Ext::_no_of_sockets = 0; int VM_Version_Ext::_no_of_sockets = 0;
#if defined(SOLARIS)
kid_t VM_Version_Ext::_kcid = -1; kid_t VM_Version_Ext::_kcid = -1;
#endif
char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {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}; char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
#if defined(SOLARIS)
// get cpu information. It takes into account if the kstat chain id // get cpu information. It takes into account if the kstat chain id
// has been changed and update the info if necessary. // has been changed and update the info if necessary.
bool VM_Version_Ext::initialize_cpu_information(void) { bool VM_Version_Ext::initialize_cpu_information(void) {
@ -144,6 +147,13 @@ bool VM_Version_Ext::initialize_cpu_information(void) {
kstat_close(kc); kstat_close(kc);
return true; return true;
} }
#elif defined(LINUX)
// get cpu information.
bool VM_Version_Ext::initialize_cpu_information(void) {
// Not yet implemented.
return false;
}
#endif
int VM_Version_Ext::number_of_threads(void) { int VM_Version_Ext::number_of_threads(void) {
initialize_cpu_information(); initialize_cpu_information();

View file

@ -27,8 +27,11 @@
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#include "vm_version_sparc.hpp" #include "vm_version_sparc.hpp"
#if defined(SOLARIS)
#include <kstat.h> #include <kstat.h>
#include <sys/processor.h> #include <sys/processor.h>
#endif
#define CPU_INFO "cpu_info" #define CPU_INFO "cpu_info"
#define CPU_TYPE "fpu_type" #define CPU_TYPE "fpu_type"
@ -45,7 +48,9 @@ class VM_Version_Ext : public VM_Version {
static int _no_of_threads; static int _no_of_threads;
static int _no_of_cores; static int _no_of_cores;
static int _no_of_sockets; static int _no_of_sockets;
#if defined(SOLARIS)
static kid_t _kcid; static kid_t _kcid;
#endif
static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE]; static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE]; static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];

View file

@ -35,6 +35,13 @@ frame JavaThread::pd_last_frame() {
return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_pc()); return frame(last_Java_sp(), frame::unpatchable, _anchor.last_Java_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.mc_i7, frame::unpatchable,
(address)uc->uc_mcontext.mc_gregs[MC_PC]);
return true;
}
// For Forte Analyzer AsyncGetCallTrace profiling support - thread is // For Forte Analyzer AsyncGetCallTrace profiling support - thread is
// currently interrupted by SIGPROF // currently interrupted by SIGPROF
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr,

View file

@ -85,8 +85,9 @@ public:
_base_of_stack_pointer = sp; _base_of_stack_pointer = sp;
} }
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
bool isInJava);
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
// These routines are only used on cpu architectures that // These routines are only used on cpu architectures that
// have separate register stacks (Itanium). // have separate register stacks (Itanium).