16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoader.hpp"
27 #include "classfile/javaClasses.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "code/codeCache.hpp"
31 #include "code/icBuffer.hpp"
32 #include "code/vtableStubs.hpp"
33 #include "gc/shared/vmGCOperations.hpp"
34 #include "interpreter/interpreter.hpp"
35 #include "logging/log.hpp"
36 #include "memory/allocation.inline.hpp"
37 #ifdef ASSERT
38 #include "memory/guardedMemory.hpp"
39 #endif
40 #include "memory/resourceArea.hpp"
41 #include "oops/oop.inline.hpp"
42 #include "prims/jvm.h"
43 #include "prims/jvm_misc.hpp"
44 #include "prims/privilegedStack.hpp"
45 #include "runtime/arguments.hpp"
46 #include "runtime/atomic.inline.hpp"
47 #include "runtime/frame.inline.hpp"
48 #include "runtime/interfaceSupport.hpp"
49 #include "runtime/java.hpp"
50 #include "runtime/javaCalls.hpp"
51 #include "runtime/mutexLocker.hpp"
52 #include "runtime/os.inline.hpp"
53 #include "runtime/stubRoutines.hpp"
54 #include "runtime/thread.inline.hpp"
55 #include "runtime/vm_version.hpp"
1477 #undef DEFINE_ENTRY
1478 #undef ALL_FLAGS
1479
1480 int i = 0;
1481 while (table[i].v != -1 && table[i].v != e) {
1482 i ++;
1483 }
1484
1485 return short_text ? table[i].short_text : table[i].long_text;
1486
1487 }
1488
1489 const char* os::strerror(int e) {
1490 return errno_to_string(e, false);
1491 }
1492
1493 const char* os::errno_name(int e) {
1494 return errno_to_string(e, true);
1495 }
1496
1497 #ifndef PRODUCT
1498 void os::trace_page_sizes(const char* str, const size_t* page_sizes, int count)
1499 {
1500 if (TracePageSizes) {
1501 tty->print("%s: ", str);
1502 for (int i = 0; i < count; ++i) {
1503 tty->print(" " SIZE_FORMAT, page_sizes[i]);
1504 }
1505 tty->cr();
1506 }
1507 }
1508
1509 void os::trace_page_sizes(const char* str, const size_t region_min_size,
1510 const size_t region_max_size, const size_t page_size,
1511 const char* base, const size_t size)
1512 {
1513 if (TracePageSizes) {
1514 tty->print_cr("%s: min=" SIZE_FORMAT " max=" SIZE_FORMAT
1515 " pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT
1516 " size=" SIZE_FORMAT,
1517 str, region_min_size, region_max_size,
1518 page_size, p2i(base), size);
1519 }
1520 }
1521 #endif // #ifndef PRODUCT
1522
1523 // This is the working definition of a server class machine:
1524 // >= 2 physical CPU's and >=2GB of memory, with some fuzz
1525 // because the graphics memory (?) sometimes masks physical memory.
1526 // If you want to change the definition of a server class machine
1527 // on some OS or platform, e.g., >=4GB on Windows platforms,
1528 // then you'll have to parameterize this method based on that state,
1529 // as was done for logical processors here, or replicate and
1530 // specialize this method for each platform. (Or fix os to have
1531 // some inheritance structure and use subclassing. Sigh.)
1532 // If you want some platform to always or never behave as a server
1533 // class machine, change the setting of AlwaysActAsServerClassMachine
1534 // and NeverActAsServerClassMachine in globals*.hpp.
1535 bool os::is_server_class_machine() {
1536 // First check for the early returns
1537 if (NeverActAsServerClassMachine) {
1538 return false;
1539 }
1540 if (AlwaysActAsServerClassMachine) {
1541 return true;
|
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "classfile/classLoader.hpp"
27 #include "classfile/javaClasses.hpp"
28 #include "classfile/systemDictionary.hpp"
29 #include "classfile/vmSymbols.hpp"
30 #include "code/codeCache.hpp"
31 #include "code/icBuffer.hpp"
32 #include "code/vtableStubs.hpp"
33 #include "gc/shared/vmGCOperations.hpp"
34 #include "interpreter/interpreter.hpp"
35 #include "logging/log.hpp"
36 #include "logging/logStream.inline.hpp"
37 #include "memory/allocation.inline.hpp"
38 #ifdef ASSERT
39 #include "memory/guardedMemory.hpp"
40 #endif
41 #include "memory/resourceArea.hpp"
42 #include "oops/oop.inline.hpp"
43 #include "prims/jvm.h"
44 #include "prims/jvm_misc.hpp"
45 #include "prims/privilegedStack.hpp"
46 #include "runtime/arguments.hpp"
47 #include "runtime/atomic.inline.hpp"
48 #include "runtime/frame.inline.hpp"
49 #include "runtime/interfaceSupport.hpp"
50 #include "runtime/java.hpp"
51 #include "runtime/javaCalls.hpp"
52 #include "runtime/mutexLocker.hpp"
53 #include "runtime/os.inline.hpp"
54 #include "runtime/stubRoutines.hpp"
55 #include "runtime/thread.inline.hpp"
56 #include "runtime/vm_version.hpp"
1478 #undef DEFINE_ENTRY
1479 #undef ALL_FLAGS
1480
1481 int i = 0;
1482 while (table[i].v != -1 && table[i].v != e) {
1483 i ++;
1484 }
1485
1486 return short_text ? table[i].short_text : table[i].long_text;
1487
1488 }
1489
1490 const char* os::strerror(int e) {
1491 return errno_to_string(e, false);
1492 }
1493
1494 const char* os::errno_name(int e) {
1495 return errno_to_string(e, true);
1496 }
1497
1498 void os::trace_page_sizes(const char* str, const size_t* page_sizes, int count) {
1499 LogTarget(Info, pagesizes) log;
1500 if (log.is_enabled()) {
1501 LogStreamCHeap out(log);
1502
1503 out.print("%s: ", str);
1504 for (int i = 0; i < count; ++i) {
1505 out.print(" " SIZE_FORMAT, page_sizes[i]);
1506 }
1507 out.cr();
1508 }
1509 }
1510
1511 #define trace_page_size_params(size) byte_size_in_exact_unit(size), exact_unit_for_byte_size(size)
1512
1513 void os::trace_page_sizes(const char* str,
1514 const size_t region_min_size,
1515 const size_t region_max_size,
1516 const size_t page_size,
1517 const char* base,
1518 const size_t size) {
1519
1520 log_info(pagesizes)("%s: "
1521 " min=" SIZE_FORMAT "%s"
1522 " max=" SIZE_FORMAT "%s"
1523 " base=" PTR_FORMAT
1524 " page_size=" SIZE_FORMAT "%s"
1525 " size=" SIZE_FORMAT "%s",
1526 str,
1527 trace_page_size_params(region_min_size),
1528 trace_page_size_params(region_max_size),
1529 p2i(base),
1530 trace_page_size_params(page_size),
1531 trace_page_size_params(size));
1532 }
1533
1534 void os::trace_page_sizes_for_requested_size(const char* str,
1535 const size_t requested_size,
1536 const size_t page_size,
1537 const size_t alignment,
1538 const char* base,
1539 const size_t size) {
1540
1541 log_info(pagesizes)("%s:"
1542 " req_size=" SIZE_FORMAT "%s"
1543 " base=" PTR_FORMAT
1544 " page_size=" SIZE_FORMAT "%s"
1545 " alignment=" SIZE_FORMAT "%s"
1546 " size=" SIZE_FORMAT "%s",
1547 str,
1548 trace_page_size_params(size),
1549 p2i(base),
1550 trace_page_size_params(page_size),
1551 trace_page_size_params(alignment),
1552 trace_page_size_params(size));
1553 }
1554
1555
1556 // This is the working definition of a server class machine:
1557 // >= 2 physical CPU's and >=2GB of memory, with some fuzz
1558 // because the graphics memory (?) sometimes masks physical memory.
1559 // If you want to change the definition of a server class machine
1560 // on some OS or platform, e.g., >=4GB on Windows platforms,
1561 // then you'll have to parameterize this method based on that state,
1562 // as was done for logical processors here, or replicate and
1563 // specialize this method for each platform. (Or fix os to have
1564 // some inheritance structure and use subclassing. Sigh.)
1565 // If you want some platform to always or never behave as a server
1566 // class machine, change the setting of AlwaysActAsServerClassMachine
1567 // and NeverActAsServerClassMachine in globals*.hpp.
1568 bool os::is_server_class_machine() {
1569 // First check for the early returns
1570 if (NeverActAsServerClassMachine) {
1571 return false;
1572 }
1573 if (AlwaysActAsServerClassMachine) {
1574 return true;
|