This commit is contained in:
Coleen Phillimore 2016-04-07 21:24:12 +00:00
commit c66cf8bde7
22 changed files with 206 additions and 300 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -24,6 +24,7 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp" #include "asm/macroAssembler.inline.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp" #include "memory/resourceArea.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
#include "runtime/os.hpp" #include "runtime/os.hpp"
@ -368,36 +369,38 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(UseUnalignedAccesses, false); FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
} }
if (PrintMiscellaneous && Verbose) { if (log_is_enabled(Info, os, cpu)) {
tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); ResourceMark rm;
tty->print_cr("L2 data cache line size: %u", L2_data_cache_line_size()); outputStream* log = Log(os, cpu)::info_stream();
tty->print("Allocation"); log->print_cr("L1 data cache line size: %u", L1_data_cache_line_size());
log->print_cr("L2 data cache line size: %u", L2_data_cache_line_size());
log->print("Allocation");
if (AllocatePrefetchStyle <= 0) { if (AllocatePrefetchStyle <= 0) {
tty->print_cr(": no prefetching"); log->print(": no prefetching");
} else { } else {
tty->print(" prefetching: "); log->print(" prefetching: ");
if (AllocatePrefetchInstr == 0) { if (AllocatePrefetchInstr == 0) {
tty->print("PREFETCH"); log->print("PREFETCH");
} else if (AllocatePrefetchInstr == 1) { } else if (AllocatePrefetchInstr == 1) {
tty->print("BIS"); log->print("BIS");
} }
if (AllocatePrefetchLines > 1) { if (AllocatePrefetchLines > 1) {
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); log->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
} else { } else {
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); log->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
} }
} }
if (PrefetchCopyIntervalInBytes > 0) { if (PrefetchCopyIntervalInBytes > 0) {
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes); log->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
} }
if (PrefetchScanIntervalInBytes > 0) { if (PrefetchScanIntervalInBytes > 0) {
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes); log->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
} }
if (PrefetchFieldsAhead > 0) { if (PrefetchFieldsAhead > 0) {
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead); log->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
} }
if (ContendedPaddingWidth > 0) { if (ContendedPaddingWidth > 0) {
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth); log->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
} }
} }
} }
@ -408,7 +411,7 @@ void VM_Version::print_features() {
int VM_Version::determine_features() { int VM_Version::determine_features() {
if (UseV8InstrsOnly) { if (UseV8InstrsOnly) {
if (PrintMiscellaneous && Verbose) { tty->print_cr("Version is Forced-V8"); } log_info(os, cpu)("Version is Forced-V8");
return generic_v8_m; return generic_v8_m;
} }
@ -416,7 +419,7 @@ int VM_Version::determine_features() {
if (features == unknown_m) { if (features == unknown_m) {
features = generic_v9_m; features = generic_v9_m;
warning("Cannot recognize SPARC version. Default to V9"); log_info(os)("Cannot recognize SPARC version. Default to V9");
} }
assert(is_T_family(features) == is_niagara(features), "Niagara should be T series"); assert(is_T_family(features) == is_niagara(features), "Niagara should be T series");
@ -424,12 +427,12 @@ int VM_Version::determine_features() {
if (is_T_family(features)) { if (is_T_family(features)) {
// Happy to accomodate... // Happy to accomodate...
} else { } else {
if (PrintMiscellaneous && Verbose) { tty->print_cr("Version is Forced-Niagara"); } log_info(os, cpu)("Version is Forced-Niagara");
features |= T_family_m; features |= T_family_m;
} }
} else { } else {
if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) { if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) {
if (PrintMiscellaneous && Verbose) { tty->print_cr("Version is Forced-Not-Niagara"); } log_info(os, cpu)("Version is Forced-Not-Niagara");
features &= ~(T_family_m | T1_model_m); features &= ~(T_family_m | T1_model_m);
} else { } else {
// Happy to accomodate... // Happy to accomodate...

View File

@ -25,6 +25,7 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "asm/macroAssembler.hpp" #include "asm/macroAssembler.hpp"
#include "asm/macroAssembler.inline.hpp" #include "asm/macroAssembler.inline.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp" #include "memory/resourceArea.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
#include "runtime/os.hpp" #include "runtime/os.hpp"
@ -1223,59 +1224,60 @@ void VM_Version::get_processor_features() {
} }
#ifndef PRODUCT #ifndef PRODUCT
if (PrintMiscellaneous && Verbose) { if (log_is_enabled(Info, os, cpu)) {
tty->print_cr("Logical CPUs per core: %u", outputStream* log = Log(os, cpu)::info_stream();
log->print_cr("Logical CPUs per core: %u",
logical_processors_per_package()); logical_processors_per_package());
tty->print_cr("L1 data cache line size: %u", L1_data_cache_line_size()); log->print_cr("L1 data cache line size: %u", L1_data_cache_line_size());
tty->print("UseSSE=%d", (int) UseSSE); log->print("UseSSE=%d", (int) UseSSE);
if (UseAVX > 0) { if (UseAVX > 0) {
tty->print(" UseAVX=%d", (int) UseAVX); log->print(" UseAVX=%d", (int) UseAVX);
} }
if (UseAES) { if (UseAES) {
tty->print(" UseAES=1"); log->print(" UseAES=1");
} }
#ifdef COMPILER2 #ifdef COMPILER2
if (MaxVectorSize > 0) { if (MaxVectorSize > 0) {
tty->print(" MaxVectorSize=%d", (int) MaxVectorSize); log->print(" MaxVectorSize=%d", (int) MaxVectorSize);
} }
#endif #endif
tty->cr(); log->cr();
tty->print("Allocation"); log->print("Allocation");
if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow_prefetch()) { if (AllocatePrefetchStyle <= 0 || UseSSE == 0 && !supports_3dnow_prefetch()) {
tty->print_cr(": no prefetching"); log->print_cr(": no prefetching");
} else { } else {
tty->print(" prefetching: "); log->print(" prefetching: ");
if (UseSSE == 0 && supports_3dnow_prefetch()) { if (UseSSE == 0 && supports_3dnow_prefetch()) {
tty->print("PREFETCHW"); log->print("PREFETCHW");
} else if (UseSSE >= 1) { } else if (UseSSE >= 1) {
if (AllocatePrefetchInstr == 0) { if (AllocatePrefetchInstr == 0) {
tty->print("PREFETCHNTA"); log->print("PREFETCHNTA");
} else if (AllocatePrefetchInstr == 1) { } else if (AllocatePrefetchInstr == 1) {
tty->print("PREFETCHT0"); log->print("PREFETCHT0");
} else if (AllocatePrefetchInstr == 2) { } else if (AllocatePrefetchInstr == 2) {
tty->print("PREFETCHT2"); log->print("PREFETCHT2");
} else if (AllocatePrefetchInstr == 3) { } else if (AllocatePrefetchInstr == 3) {
tty->print("PREFETCHW"); log->print("PREFETCHW");
} }
} }
if (AllocatePrefetchLines > 1) { if (AllocatePrefetchLines > 1) {
tty->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize); log->print_cr(" at distance %d, %d lines of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchLines, (int) AllocatePrefetchStepSize);
} else { } else {
tty->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize); log->print_cr(" at distance %d, one line of %d bytes", (int) AllocatePrefetchDistance, (int) AllocatePrefetchStepSize);
} }
} }
if (PrefetchCopyIntervalInBytes > 0) { if (PrefetchCopyIntervalInBytes > 0) {
tty->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes); log->print_cr("PrefetchCopyIntervalInBytes %d", (int) PrefetchCopyIntervalInBytes);
} }
if (PrefetchScanIntervalInBytes > 0) { if (PrefetchScanIntervalInBytes > 0) {
tty->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes); log->print_cr("PrefetchScanIntervalInBytes %d", (int) PrefetchScanIntervalInBytes);
} }
if (PrefetchFieldsAhead > 0) { if (PrefetchFieldsAhead > 0) {
tty->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead); log->print_cr("PrefetchFieldsAhead %d", (int) PrefetchFieldsAhead);
} }
if (ContendedPaddingWidth > 0) { if (ContendedPaddingWidth > 0) {
tty->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth); log->print_cr("ContendedPaddingWidth %d", (int) ContendedPaddingWidth);
} }
} }
#endif // !PRODUCT #endif // !PRODUCT

View File

@ -3612,14 +3612,12 @@ jint os::init_2(void) {
struct rlimit nbr_files; struct rlimit nbr_files;
int status = getrlimit(RLIMIT_NOFILE, &nbr_files); int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno));
perror("os::init_2 getrlimit failed");
} else { } else {
nbr_files.rlim_cur = nbr_files.rlim_max; nbr_files.rlim_cur = nbr_files.rlim_max;
status = setrlimit(RLIMIT_NOFILE, &nbr_files); status = setrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) log_info(os)("os::init_2 setrlimit failed: %s", os::strerror(errno));
perror("os::init_2 setrlimit failed");
} }
} }
} }

View File

@ -3459,25 +3459,13 @@ jint os::init_2(void) {
guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page"); guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page(polling_page); os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n",
(intptr_t)polling_page);
}
#endif
if (!UseMembar) { if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); address mem_serialize_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page); os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n",
(intptr_t)mem_serialize_page);
}
#endif
} }
// initialize suspend/resume support - must do this before signal_sets_init() // initialize suspend/resume support - must do this before signal_sets_init()
@ -3519,9 +3507,7 @@ jint os::init_2(void) {
struct rlimit nbr_files; struct rlimit nbr_files;
int status = getrlimit(RLIMIT_NOFILE, &nbr_files); int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno));
perror("os::init_2 getrlimit failed");
}
} else { } else {
nbr_files.rlim_cur = nbr_files.rlim_max; nbr_files.rlim_cur = nbr_files.rlim_max;
@ -3534,9 +3520,7 @@ jint os::init_2(void) {
status = setrlimit(RLIMIT_NOFILE, &nbr_files); status = setrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("os::init_2 setrlimit failed: %s", os::strerror(errno));
perror("os::init_2 setrlimit failed");
}
} }
} }
} }

View File

@ -2163,7 +2163,7 @@ static bool print_model_name_and_flags(outputStream* st, char* buf, size_t bufle
bool model_name_printed = false; bool model_name_printed = false;
if (strstr(buf, "model name") != NULL) { if (strstr(buf, "model name") != NULL) {
if (!model_name_printed) { if (!model_name_printed) {
st->print_raw("\nCPU Model and flags from /proc/cpuinfo:\n"); st->print_raw("CPU Model and flags from /proc/cpuinfo:\n");
st->print_raw(buf); st->print_raw(buf);
model_name_printed = true; model_name_printed = true;
} else { } else {
@ -4671,25 +4671,13 @@ jint os::init_2(void) {
guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page"); guarantee(polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page");
os::set_polling_page(polling_page); os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n",
(intptr_t)polling_page);
}
#endif
if (!UseMembar) { if (!UseMembar) {
address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); address mem_serialize_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ | PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page"); guarantee(mem_serialize_page != MAP_FAILED, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page); os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n",
(intptr_t)mem_serialize_page);
}
#endif
} }
// initialize suspend/resume support - must do this before signal_sets_init() // initialize suspend/resume support - must do this before signal_sets_init()
@ -4732,10 +4720,8 @@ jint os::init_2(void) {
#endif #endif
Linux::libpthread_init(); Linux::libpthread_init();
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("HotSpot is running with %s, %s",
tty->print_cr("[HotSpot is running with %s, %s]\n", Linux::glibc_version(), Linux::libpthread_version());
Linux::glibc_version(), Linux::libpthread_version());
}
if (UseNUMA) { if (UseNUMA) {
if (!Linux::libnuma_init()) { if (!Linux::libnuma_init()) {
@ -4776,16 +4762,12 @@ jint os::init_2(void) {
struct rlimit nbr_files; struct rlimit nbr_files;
int status = getrlimit(RLIMIT_NOFILE, &nbr_files); int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno));
perror("os::init_2 getrlimit failed");
}
} else { } else {
nbr_files.rlim_cur = nbr_files.rlim_max; nbr_files.rlim_cur = nbr_files.rlim_max;
status = setrlimit(RLIMIT_NOFILE, &nbr_files); status = setrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("os::init_2 setrlimit failed: %s", os::strerror(errno));
perror("os::init_2 setrlimit failed");
}
} }
} }
} }

View File

@ -2754,13 +2754,13 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
pd_unmap_memory(addr, bytes); pd_unmap_memory(addr, bytes);
} }
if (PrintMiscellaneous && Verbose) { if (log_is_enabled(Warning, os)) {
char buf[256]; char buf[256];
buf[0] = '\0'; buf[0] = '\0';
if (addr == NULL) { if (addr == NULL) {
jio_snprintf(buf, sizeof(buf), ": %s", os::strerror(err)); jio_snprintf(buf, sizeof(buf), ": %s", os::strerror(err));
} }
warning("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at " log_info(os)("attempt_reserve_memory_at: couldn't reserve " SIZE_FORMAT " bytes at "
PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT PTR_FORMAT ": reserve_memory_helper returned " PTR_FORMAT
"%s", bytes, requested_addr, addr, buf); "%s", bytes, requested_addr, addr, buf);
} }
@ -2790,9 +2790,7 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
assert(i > 0, "gap adjustment code problem"); assert(i > 0, "gap adjustment code problem");
have_adjusted_gap = true; // adjust the gap only once, just in case have_adjusted_gap = true; // adjust the gap only once, just in case
gap = actual_gap; gap = actual_gap;
if (PrintMiscellaneous && Verbose) { log_info(os)("attempt_reserve_memory_at: adjusted gap to 0x%lx", gap);
warning("attempt_reserve_memory_at: adjusted gap to 0x%lx", gap);
}
unmap_memory(base[i], bytes); unmap_memory(base[i], bytes);
unmap_memory(base[i-1], size[i-1]); unmap_memory(base[i-1], size[i-1]);
i-=2; i-=2;
@ -2824,8 +2822,8 @@ char* os::pd_attempt_reserve_memory_at(size_t bytes, char* requested_addr) {
} else { } else {
size_t bottom_overlap = base[i] + bytes - requested_addr; size_t bottom_overlap = base[i] + bytes - requested_addr;
if (bottom_overlap >= 0 && bottom_overlap < bytes) { if (bottom_overlap >= 0 && bottom_overlap < bytes) {
if (PrintMiscellaneous && Verbose && bottom_overlap == 0) { if (bottom_overlap == 0) {
warning("attempt_reserve_memory_at: possible alignment bug"); log_info(os)("attempt_reserve_memory_at: possible alignment bug");
} }
unmap_memory(requested_addr, bottom_overlap); unmap_memory(requested_addr, bottom_overlap);
size[i] = bytes - bottom_overlap; size[i] = bytes - bottom_overlap;
@ -4355,8 +4353,8 @@ static pset_getloadavg_type pset_getloadavg_ptr = NULL;
void init_pset_getloadavg_ptr(void) { void init_pset_getloadavg_ptr(void) {
pset_getloadavg_ptr = pset_getloadavg_ptr =
(pset_getloadavg_type)dlsym(RTLD_DEFAULT, "pset_getloadavg"); (pset_getloadavg_type)dlsym(RTLD_DEFAULT, "pset_getloadavg");
if (PrintMiscellaneous && Verbose && pset_getloadavg_ptr == NULL) { if (pset_getloadavg_ptr == NULL) {
warning("pset_getloadavg function not found"); log_warning(os)("pset_getloadavg function not found");
} }
} }
@ -4439,25 +4437,13 @@ jint os::init_2(void) {
} }
os::set_polling_page(polling_page); os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n",
(intptr_t)polling_page);
}
#endif
if (!UseMembar) { if (!UseMembar) {
address mem_serialize_page = (address)Solaris::mmap_chunk(NULL, page_size, MAP_PRIVATE, PROT_READ | PROT_WRITE); address mem_serialize_page = (address)Solaris::mmap_chunk(NULL, page_size, MAP_PRIVATE, PROT_READ | PROT_WRITE);
guarantee(mem_serialize_page != NULL, "mmap Failed for memory serialize page"); guarantee(mem_serialize_page != NULL, "mmap Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page); os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n",
(intptr_t)mem_serialize_page);
}
#endif
} }
// Check minimum allowable stack size for thread creation and to initialize // Check minimum allowable stack size for thread creation and to initialize
@ -4537,16 +4523,12 @@ jint os::init_2(void) {
struct rlimit nbr_files; struct rlimit nbr_files;
int status = getrlimit(RLIMIT_NOFILE, &nbr_files); int status = getrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("os::init_2 getrlimit failed: %s", os::strerror(errno));
perror("os::init_2 getrlimit failed");
}
} else { } else {
nbr_files.rlim_cur = nbr_files.rlim_max; nbr_files.rlim_cur = nbr_files.rlim_max;
status = setrlimit(RLIMIT_NOFILE, &nbr_files); status = setrlimit(RLIMIT_NOFILE, &nbr_files);
if (status != 0) { if (status != 0) {
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("os::init_2 setrlimit failed: %s", os::strerror(errno));
perror("os::init_2 setrlimit failed");
}
} }
} }
} }

View File

@ -2436,14 +2436,10 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
bool res = os::protect_memory((char*) page_start, page_size, bool res = os::protect_memory((char*) page_start, page_size,
os::MEM_PROT_RWX); os::MEM_PROT_RWX);
if (PrintMiscellaneous && Verbose) { log_debug(os)("Execution protection violation "
char buf[256]; "at " INTPTR_FORMAT
jio_snprintf(buf, sizeof(buf), "Execution protection violation " ", unguarding " INTPTR_FORMAT ": %s", p2i(addr),
"at " INTPTR_FORMAT p2i(page_start), (res ? "success" : os::strerror(errno)));
", unguarding " INTPTR_FORMAT ": %s", addr,
page_start, (res ? "success" : os::strerror(errno)));
tty->print_raw_cr(buf);
}
// Set last_addr so if we fault again at the same address, we don't // Set last_addr so if we fault again at the same address, we don't
// end up in an endless loop. // end up in an endless loop.
@ -2896,12 +2892,12 @@ static bool numa_interleaving_init() {
NUMAInterleaveGranularity = align_size_up(NUMAInterleaveGranularity, min_interleave_granularity); NUMAInterleaveGranularity = align_size_up(NUMAInterleaveGranularity, min_interleave_granularity);
if (numa_node_list_holder.build()) { if (numa_node_list_holder.build()) {
if (PrintMiscellaneous && Verbose) { if (log_is_enabled(Debug, os, cpu)) {
tty->print("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count()); Log(os, cpu) log;
log.debug("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count());
for (int i = 0; i < numa_node_list_holder.get_count(); i++) { for (int i = 0; i < numa_node_list_holder.get_count(); i++) {
tty->print("%d ", numa_node_list_holder.get_node_list_entry(i)); log.debug(" %d ", numa_node_list_holder.get_node_list_entry(i));
} }
tty->print("\n");
} }
success = true; success = true;
} else { } else {
@ -4119,13 +4115,7 @@ jint os::init_2(void) {
guarantee(return_page != NULL, "Commit Failed for polling page"); guarantee(return_page != NULL, "Commit Failed for polling page");
os::set_polling_page(polling_page); os::set_polling_page(polling_page);
log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(polling_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[SafePoint Polling address: " INTPTR_FORMAT "]\n",
(intptr_t)polling_page);
}
#endif
if (!UseMembar) { if (!UseMembar) {
address mem_serialize_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READWRITE); address mem_serialize_page = (address)VirtualAlloc(NULL, os::vm_page_size(), MEM_RESERVE, PAGE_READWRITE);
@ -4135,13 +4125,7 @@ jint os::init_2(void) {
guarantee(return_page != NULL, "Commit Failed for memory serialize page"); guarantee(return_page != NULL, "Commit Failed for memory serialize page");
os::set_memory_serialize_page(mem_serialize_page); os::set_memory_serialize_page(mem_serialize_page);
log_info(os)("Memory Serialize Page address: " INTPTR_FORMAT, p2i(mem_serialize_page));
#ifndef PRODUCT
if (Verbose && PrintMiscellaneous) {
tty->print("[Memory Serialize Page address: " INTPTR_FORMAT "]\n",
(intptr_t)mem_serialize_page);
}
#endif
} }
// Setup Windows Exceptions // Setup Windows Exceptions
@ -4769,10 +4753,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
hFile = CreateFile(file_name, GENERIC_READ, FILE_SHARE_READ, NULL, hFile = CreateFile(file_name, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == NULL) { if (hFile == NULL) {
if (PrintMiscellaneous && Verbose) { log_info(os)("CreateFile() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("CreateFile() failed: GetLastError->%ld.", err);
}
return NULL; return NULL;
} }
@ -4790,10 +4771,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
base = (char*) VirtualAlloc(addr, bytes, MEM_COMMIT | MEM_RESERVE, base = (char*) VirtualAlloc(addr, bytes, MEM_COMMIT | MEM_RESERVE,
PAGE_READWRITE); PAGE_READWRITE);
if (base == NULL) { if (base == NULL) {
if (PrintMiscellaneous && Verbose) { log_info(os)("VirtualAlloc() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("VirtualAlloc() failed: GetLastError->%ld.", err);
}
CloseHandle(hFile); CloseHandle(hFile);
return NULL; return NULL;
} }
@ -4807,10 +4785,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
// number of bytes were read before returning. // number of bytes were read before returning.
bool res = ReadFile(hFile, base, (DWORD)bytes, &bytes_read, &overlapped) != 0; bool res = ReadFile(hFile, base, (DWORD)bytes, &bytes_read, &overlapped) != 0;
if (!res) { if (!res) {
if (PrintMiscellaneous && Verbose) { log_info(os)("ReadFile() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("ReadFile() failed: GetLastError->%ld.", err);
}
release_memory(base, bytes); release_memory(base, bytes);
CloseHandle(hFile); CloseHandle(hFile);
return NULL; return NULL;
@ -4819,10 +4794,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
HANDLE hMap = CreateFileMapping(hFile, NULL, PAGE_WRITECOPY, 0, 0, HANDLE hMap = CreateFileMapping(hFile, NULL, PAGE_WRITECOPY, 0, 0,
NULL /* file_name */); NULL /* file_name */);
if (hMap == NULL) { if (hMap == NULL) {
if (PrintMiscellaneous && Verbose) { log_info(os)("CreateFileMapping() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("CreateFileMapping() failed: GetLastError->%ld.", err);
}
CloseHandle(hFile); CloseHandle(hFile);
return NULL; return NULL;
} }
@ -4831,20 +4803,14 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
base = (char*)MapViewOfFileEx(hMap, access, 0, (DWORD)file_offset, base = (char*)MapViewOfFileEx(hMap, access, 0, (DWORD)file_offset,
(DWORD)bytes, addr); (DWORD)bytes, addr);
if (base == NULL) { if (base == NULL) {
if (PrintMiscellaneous && Verbose) { log_info(os)("MapViewOfFileEx() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("MapViewOfFileEx() failed: GetLastError->%ld.", err);
}
CloseHandle(hMap); CloseHandle(hMap);
CloseHandle(hFile); CloseHandle(hFile);
return NULL; return NULL;
} }
if (CloseHandle(hMap) == 0) { if (CloseHandle(hMap) == 0) {
if (PrintMiscellaneous && Verbose) { log_info(os)("CloseHandle(hMap) failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("CloseHandle(hMap) failed: GetLastError->%ld.", err);
}
CloseHandle(hFile); CloseHandle(hFile);
return base; return base;
} }
@ -4856,10 +4822,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
bool res = VirtualProtect(base, bytes, exec_access, &old_protect) != 0; bool res = VirtualProtect(base, bytes, exec_access, &old_protect) != 0;
if (!res) { if (!res) {
if (PrintMiscellaneous && Verbose) { log_info(os)("VirtualProtect() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("VirtualProtect() failed: GetLastError->%ld.", err);
}
// Don't consider this a hard error, on IA32 even if the // Don't consider this a hard error, on IA32 even if the
// VirtualProtect fails, we should still be able to execute // VirtualProtect fails, we should still be able to execute
CloseHandle(hFile); CloseHandle(hFile);
@ -4868,10 +4831,7 @@ char* os::pd_map_memory(int fd, const char* file_name, size_t file_offset,
} }
if (CloseHandle(hFile) == 0) { if (CloseHandle(hFile) == 0) {
if (PrintMiscellaneous && Verbose) { log_info(os)("CloseHandle(hFile) failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("CloseHandle(hFile) failed: GetLastError->%ld.", err);
}
return base; return base;
} }
@ -4904,10 +4864,7 @@ char* os::pd_remap_memory(int fd, const char* file_name, size_t file_offset,
bool os::pd_unmap_memory(char* addr, size_t bytes) { bool os::pd_unmap_memory(char* addr, size_t bytes) {
MEMORY_BASIC_INFORMATION mem_info; MEMORY_BASIC_INFORMATION mem_info;
if (VirtualQuery(addr, &mem_info, sizeof(mem_info)) == 0) { if (VirtualQuery(addr, &mem_info, sizeof(mem_info)) == 0) {
if (PrintMiscellaneous && Verbose) { log_info(os)("VirtualQuery() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("VirtualQuery() failed: GetLastError->%ld.", err);
}
return false; return false;
} }
@ -4924,10 +4881,7 @@ bool os::pd_unmap_memory(char* addr, size_t bytes) {
BOOL result = UnmapViewOfFile(addr); BOOL result = UnmapViewOfFile(addr);
if (result == 0) { if (result == 0) {
if (PrintMiscellaneous && Verbose) { log_info(os)("UnmapViewOfFile() failed: GetLastError->%ld.", GetLastError());
DWORD err = GetLastError();
tty->print_cr("UnmapViewOfFile() failed: GetLastError->%ld.", err);
}
return false; return false;
} }
return true; return true;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2014 SAP SE. All rights reserved. * Copyright (c) 2012, 2014 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -184,9 +184,7 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
if (os::Aix::chained_handler(sig, info, ucVoid)) { if (os::Aix::chained_handler(sig, info, ucVoid)) {
return 1; return 1;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE - see bugs 4229104
warning("Ignoring SIGPIPE - see bug 4229104");
}
return 1; return 1;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -469,11 +469,7 @@ JVM_handle_bsd_signal(int sig,
if (os::Bsd::chained_handler(sig, info, ucVoid)) { if (os::Bsd::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see bugs 4229104 or 646499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }
@ -728,14 +724,10 @@ JVM_handle_bsd_signal(int sig,
bool res = os::protect_memory((char*) page_start, page_size, bool res = os::protect_memory((char*) page_start, page_size,
os::MEM_PROT_RWX); os::MEM_PROT_RWX);
if (PrintMiscellaneous && Verbose) { log_debug(os)("Execution protection violation "
char buf[256]; "at " INTPTR_FORMAT
jio_snprintf(buf, sizeof(buf), "Execution protection violation " ", unguarding " INTPTR_FORMAT ": %s, errno=%d", p2i(addr),
"at " INTPTR_FORMAT p2i(page_start), (res ? "success" : "failed"), errno);
", unguarding " INTPTR_FORMAT ": %s, errno=%d", addr,
page_start, (res ? "success" : "failed"), errno);
tty->print_raw_cr(buf);
}
stub = pc; stub = pc;
// Set last_addr so if we fault again at the same address, we don't end // Set last_addr so if we fault again at the same address, we don't end

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -159,11 +159,7 @@ JVM_handle_bsd_signal(int sig,
if (os::Bsd::chained_handler(sig, info, ucVoid)) { if (os::Bsd::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see bugs 4229104 or 646499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -270,11 +270,7 @@ JVM_handle_linux_signal(int sig,
if (os::Linux::chained_handler(sig, info, ucVoid)) { if (os::Linux::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see bugs 4229104 or 646499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
@ -198,9 +198,7 @@ JVM_handle_linux_signal(int sig,
if (os::Linux::chained_handler(sig, info, ucVoid)) { if (os::Linux::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE - see bugs 4229104
warning("Ignoring SIGPIPE - see bug 4229104");
}
return true; return true;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -561,11 +561,7 @@ JVM_handle_linux_signal(int sig,
if (os::Linux::chained_handler(sig, info, ucVoid)) { if (os::Linux::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see bugs 4229104 or 646499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -66,12 +66,12 @@ int VM_Version::platform_features(int features) {
features = generic_v9_m; features = generic_v9_m;
if (detect_niagara()) { if (detect_niagara()) {
if (PrintMiscellaneous && Verbose) { tty->print_cr("Detected Linux on Niagara"); } log_info(os, cpu)("Detected Linux on Niagara");
features = niagara1_m | T_family_m; features = niagara1_m | T_family_m;
} }
if (detect_M_family()) { if (detect_M_family()) {
if (PrintMiscellaneous && Verbose) { tty->print_cr("Detected Linux on M family"); } log_info(os, cpu)("Detected Linux on M family");
features = sun4v_m | generic_v9_m | M_family_m | T_family_m; features = sun4v_m | generic_v9_m | M_family_m | T_family_m;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -287,11 +287,7 @@ JVM_handle_linux_signal(int sig,
if (os::Linux::chained_handler(sig, info, ucVoid)) { if (os::Linux::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see bugs 4229104 or 646499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }
@ -542,14 +538,10 @@ JVM_handle_linux_signal(int sig,
bool res = os::protect_memory((char*) page_start, page_size, bool res = os::protect_memory((char*) page_start, page_size,
os::MEM_PROT_RWX); os::MEM_PROT_RWX);
if (PrintMiscellaneous && Verbose) { log_debug(os)("Execution protection violation "
char buf[256]; "at " INTPTR_FORMAT
jio_snprintf(buf, sizeof(buf), "Execution protection violation " ", unguarding " INTPTR_FORMAT ": %s, errno=%d", p2i(addr),
"at " INTPTR_FORMAT p2i(page_start), (res ? "success" : "failed"), errno);
", unguarding " INTPTR_FORMAT ": %s, errno=%d", addr,
page_start, (res ? "success" : "failed"), errno);
tty->print_raw_cr(buf);
}
stub = pc; stub = pc;
// Set last_addr so if we fault again at the same address, we don't end // Set last_addr so if we fault again at the same address, we don't end
@ -645,12 +637,8 @@ bool os::supports_sse() {
int major = strtol(uts.release,&minor_string,10); int major = strtol(uts.release,&minor_string,10);
int minor = strtol(minor_string+1,NULL,10); int minor = strtol(minor_string+1,NULL,10);
bool result = (major > 2 || (major==2 && minor >= 4)); bool result = (major > 2 || (major==2 && minor >= 4));
#ifndef PRODUCT log_info(os)("OS version is %d.%d, which %s support SSE/SSE2",
if (PrintMiscellaneous && Verbose) {
tty->print("OS version is %d.%d, which %s support SSE/SSE2\n",
major,minor, result ? "DOES" : "does NOT"); major,minor, result ? "DOES" : "does NOT");
}
#endif
return result; return result;
#endif // AMD64 #endif // AMD64
} }
@ -939,9 +927,7 @@ void os::workaround_expand_exec_shield_cs_limit() {
MemTracker::record_virtual_memory_type((address)codebuf, mtInternal); MemTracker::record_virtual_memory_type((address)codebuf, mtInternal);
if (PrintMiscellaneous && (Verbose || WizardMode)) { log_info(os)("[CS limit NX emulation work-around, exec code at: %p]", codebuf);
tty->print_cr("[CS limit NX emulation work-around, exec code at: %p]", codebuf);
}
// Some code to exec: the 'ret' instruction // Some code to exec: the 'ret' instruction
codebuf[0] = 0xC3; codebuf[0] = 0xC3;

View File

@ -154,11 +154,7 @@ JVM_handle_linux_signal(int sig,
if (os::Linux::chained_handler(sig, info, ucVoid)) { if (os::Linux::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see bugs 4229104 or 646499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -338,12 +338,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
if (os::Solaris::chained_handler(sig, info, ucVoid)) { if (os::Solaris::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see 4229104 or 6499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,6 +23,7 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "logging/log.hpp"
#include "memory/allocation.hpp" #include "memory/allocation.hpp"
#include "memory/allocation.inline.hpp" #include "memory/allocation.inline.hpp"
#include "runtime/os.hpp" #include "runtime/os.hpp"
@ -361,15 +362,10 @@ int VM_Version::platform_features(int features) {
assert(avn <= 2, "should return two or less av's"); assert(avn <= 2, "should return two or less av's");
uint_t av = avs[0]; uint_t av = avs[0];
#ifndef PRODUCT log_info(os, cpu)("getisax(2) returned: " PTR32_FORMAT, av);
if (PrintMiscellaneous && Verbose) { if (avn > 1) {
tty->print("getisax(2) returned: " PTR32_FORMAT, av); log_info(os, cpu)(" " PTR32_FORMAT, avs[1]);
if (avn > 1) {
tty->print(", " PTR32_FORMAT, avs[1]);
}
tty->cr();
} }
#endif
if (av & AV_SPARC_MUL32) features |= hardware_mul32_m; if (av & AV_SPARC_MUL32) features |= hardware_mul32_m;
if (av & AV_SPARC_DIV32) features |= hardware_div32_m; if (av & AV_SPARC_DIV32) features |= hardware_div32_m;
@ -464,11 +460,7 @@ int VM_Version::platform_features(int features) {
if (strcmp((const char*)&(knm[i].name),"implementation") == 0) { if (strcmp((const char*)&(knm[i].name),"implementation") == 0) {
implementation = KSTAT_NAMED_STR_PTR(&knm[i]); implementation = KSTAT_NAMED_STR_PTR(&knm[i]);
has_implementation = true; has_implementation = true;
#ifndef PRODUCT log_info(os, cpu)("cpu_info.implementation: %s", implementation);
if (PrintMiscellaneous && Verbose) {
tty->print_cr("cpu_info.implementation: %s", implementation);
}
#endif
features |= parse_features(implementation); features |= parse_features(implementation);
break; break;
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -403,12 +403,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
if (os::Solaris::chained_handler(sig, info, ucVoid)) { if (os::Solaris::chained_handler(sig, info, ucVoid)) {
return true; return true;
} else { } else {
if (PrintMiscellaneous && (WizardMode || Verbose)) { // Ignoring SIGPIPE/SIGXFSZ - see bugs 4229104 or 6499219
char buf[64];
warning("Ignoring %s - see 4229104 or 6499219",
os::exception_name(sig, buf, sizeof(buf)));
}
return true; return true;
} }
} }
@ -640,14 +635,10 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
bool res = os::protect_memory((char*) page_start, page_size, bool res = os::protect_memory((char*) page_start, page_size,
os::MEM_PROT_RWX); os::MEM_PROT_RWX);
if (PrintMiscellaneous && Verbose) { log_debug(os)("Execution protection violation "
char buf[256]; "at " INTPTR_FORMAT
jio_snprintf(buf, sizeof(buf), "Execution protection violation " ", unguarding " INTPTR_FORMAT ": %s, errno=%d", p2i(addr),
"at " INTPTR_FORMAT p2i(page_start), (res ? "success" : "failed"), errno);
", unguarding " INTPTR_FORMAT ": %s, errno=%d", addr,
page_start, (res ? "success" : "failed"), errno);
tty->print_raw_cr(buf);
}
stub = pc; stub = pc;
// Set last_addr so if we fault again at the same address, we don't end // Set last_addr so if we fault again at the same address, we don't end

View File

@ -377,7 +377,7 @@ void Test_loghandle_on() {
assert(log_handle.is_debug(), "assert"); assert(log_handle.is_debug(), "assert");
// Try to log trough a LogHandle. // Try to log through a LogHandle.
log_handle.debug("%d workers", 3); log_handle.debug("%d workers", 3);
FILE* fp = fopen(log_file.name(), "r"); FILE* fp = fopen(log_file.name(), "r");
@ -408,7 +408,7 @@ void Test_loghandle_off() {
return; return;
} }
// Try to log trough a LogHandle. Should fail, since only info is turned on. // Try to log through a LogHandle. Should fail, since only info is turned on.
log_handle.debug("%d workers", 3); log_handle.debug("%d workers", 3);
// Log a dummy line so that fgets doesn't return NULL because the file is empty. // Log a dummy line so that fgets doesn't return NULL because the file is empty.
@ -440,7 +440,7 @@ static void Test_logtargethandle_on() {
assert(log_handle.is_enabled(), "assert"); assert(log_handle.is_enabled(), "assert");
// Try to log trough a LogHandle. // Try to log through a LogHandle.
log_handle.print("%d workers", 3); log_handle.print("%d workers", 3);
FILE* fp = fopen(log_file.name(), "r"); FILE* fp = fopen(log_file.name(), "r");
@ -471,7 +471,7 @@ static void Test_logtargethandle_off() {
return; return;
} }
// Try to log trough a LogHandle. Should fail, since only info is turned on. // Try to log through a LogHandle. Should fail, since only info is turned on.
log_handle.print("%d workers", 3); log_handle.print("%d workers", 3);
// Log a dummy line so that fgets doesn't return NULL because the file is empty. // Log a dummy line so that fgets doesn't return NULL because the file is empty.

View File

@ -24,6 +24,7 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "code/codeCacheExtensions.hpp" #include "code/codeCacheExtensions.hpp"
#include "logging/log.hpp"
#include "memory/universe.hpp" #include "memory/universe.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "runtime/arguments.hpp" #include "runtime/arguments.hpp"
@ -274,12 +275,12 @@ unsigned int Abstract_VM_Version::jvm_version() {
void VM_Version_init() { void VM_Version_init() {
VM_Version::initialize(); VM_Version::initialize();
#ifndef PRODUCT if (log_is_enabled(Info, os, cpu)) {
if (PrintMiscellaneous && Verbose) { char buf[1024];
char buf[512]; ResourceMark rm;
os::print_cpu_info(tty, buf, sizeof(buf)); outputStream* log = Log(os, cpu)::info_stream();
os::print_cpu_info(log, buf, sizeof(buf));
} }
#endif
} }
unsigned int Abstract_VM_Version::nof_parallel_worker_threads( unsigned int Abstract_VM_Version::nof_parallel_worker_threads(

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2016, 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.
*/
/*
* @test
* @bug 8151939
* @summary os+cpu output should contain some os,cpu information
* @library /testlibrary
* @modules java.base/sun.misc
* java.management
* @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools
* @run driver OsCpuLoggingTest
*/
import java.io.File;
import java.util.Map;
import jdk.test.lib.*;
public class OsCpuLoggingTest {
static void analyzeOutputForOsLog(OutputAnalyzer output) throws Exception {
// Aix has it's own logging
if (!Platform.isAix()) {
output.shouldContain("SafePoint Polling address");
}
output.shouldHaveExitValue(0);
}
static void analyzeOutputForOsCpuLog(OutputAnalyzer output) throws Exception {
output.shouldContain("CPU:total");
output.shouldHaveExitValue(0);
}
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+cpu", "-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
analyzeOutputForOsCpuLog(output);
pb = ProcessTools.createJavaProcessBuilder("-Xlog:os", "-version");
output = new OutputAnalyzer(pb.start());
analyzeOutputForOsLog(output);
}
}