1 /*
2 * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
1428 // real_total: Sum of all system pools
1429 // real_free: always 0
1430 // pgsp_total: we take the size of the system ASP
1431 // pgsp_free: size of system ASP times percentage of system ASP unused
1432 st->print_cr("physical total : " SIZE_FORMAT, mi.real_total);
1433 st->print_cr("system asp total : " SIZE_FORMAT, mi.pgsp_total);
1434 st->print_cr("%% system asp used : " SIZE_FORMAT,
1435 mi.pgsp_total ? (100.0f * (mi.pgsp_total - mi.pgsp_free) / mi.pgsp_total) : -1.0f);
1436 }
1437 st->print_raw(buffer);
1438 }
1439 st->cr();
1440
1441 // Print segments allocated with os::reserve_memory.
1442 st->print_cr("internal virtual memory regions used by vm:");
1443 vmembk_print_on(st);
1444 }
1445
1446 // Get a string for the cpuinfo that is a summary of the cpu type
1447 void os::get_summary_cpu_info(char* buf, size_t buflen) {
1448 // This looks good
1449 libperfstat::cpuinfo_t ci;
1450 if (libperfstat::get_cpuinfo(&ci)) {
1451 strncpy(buf, ci.version, buflen);
1452 } else {
1453 strncpy(buf, "AIX", buflen);
1454 }
1455 }
1456
1457 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
1458 // Nothing to do beyond what os::print_cpu_info() does.
1459 }
1460
1461 static void print_signal_handler(outputStream* st, int sig,
1462 char* buf, size_t buflen);
1463
1464 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
1465 st->print_cr("Signal Handlers:");
1466 print_signal_handler(st, SIGSEGV, buf, buflen);
1467 print_signal_handler(st, SIGBUS , buf, buflen);
1468 print_signal_handler(st, SIGFPE , buf, buflen);
1469 print_signal_handler(st, SIGPIPE, buf, buflen);
1470 print_signal_handler(st, SIGXFSZ, buf, buflen);
1471 print_signal_handler(st, SIGILL , buf, buflen);
1472 print_signal_handler(st, SR_signum, buf, buflen);
1473 print_signal_handler(st, SHUTDOWN1_SIGNAL, buf, buflen);
1474 print_signal_handler(st, SHUTDOWN2_SIGNAL , buf, buflen);
1475 print_signal_handler(st, SHUTDOWN3_SIGNAL , buf, buflen);
1476 print_signal_handler(st, BREAK_SIGNAL, buf, buflen);
1477 print_signal_handler(st, SIGTRAP, buf, buflen);
1478 // We also want to know if someone else adds a SIGDANGER handler because
|
1 /*
2 * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2018 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
1428 // real_total: Sum of all system pools
1429 // real_free: always 0
1430 // pgsp_total: we take the size of the system ASP
1431 // pgsp_free: size of system ASP times percentage of system ASP unused
1432 st->print_cr("physical total : " SIZE_FORMAT, mi.real_total);
1433 st->print_cr("system asp total : " SIZE_FORMAT, mi.pgsp_total);
1434 st->print_cr("%% system asp used : " SIZE_FORMAT,
1435 mi.pgsp_total ? (100.0f * (mi.pgsp_total - mi.pgsp_free) / mi.pgsp_total) : -1.0f);
1436 }
1437 st->print_raw(buffer);
1438 }
1439 st->cr();
1440
1441 // Print segments allocated with os::reserve_memory.
1442 st->print_cr("internal virtual memory regions used by vm:");
1443 vmembk_print_on(st);
1444 }
1445
1446 // Get a string for the cpuinfo that is a summary of the cpu type
1447 void os::get_summary_cpu_info(char* buf, size_t buflen) {
1448 // read _system_configuration.version
1449 switch (_system_configuration.version) {
1450 case PV_8:
1451 strncpy(buf, "Power PC 8", buflen);
1452 break;
1453 case PV_7:
1454 strncpy(buf, "Power PC 7", buflen);
1455 break;
1456 case PV_6_1:
1457 strncpy(buf, "Power PC 6 DD1.x", buflen);
1458 break;
1459 case PV_6:
1460 strncpy(buf, "Power PC 6", buflen);
1461 break;
1462 case PV_5:
1463 strncpy(buf, "Power PC 5", buflen);
1464 break;
1465 case PV_5_2:
1466 strncpy(buf, "Power PC 5_2", buflen);
1467 break;
1468 case PV_5_3:
1469 strncpy(buf, "Power PC 5_3", buflen);
1470 break;
1471 case PV_5_Compat:
1472 strncpy(buf, "PV_5_Compat", buflen);
1473 break;
1474 case PV_6_Compat:
1475 strncpy(buf, "PV_6_Compat", buflen);
1476 break;
1477 case PV_7_Compat:
1478 strncpy(buf, "PV_7_Compat", buflen);
1479 break;
1480 case PV_8_Compat:
1481 strncpy(buf, "PV_8_Compat", buflen);
1482 break;
1483 default:
1484 strncpy(buf, "unknown", buflen);
1485 }
1486 }
1487
1488 void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) {
1489 // Nothing to do beyond of what os::print_cpu_info() does.
1490 }
1491
1492 static void print_signal_handler(outputStream* st, int sig,
1493 char* buf, size_t buflen);
1494
1495 void os::print_signal_handlers(outputStream* st, char* buf, size_t buflen) {
1496 st->print_cr("Signal Handlers:");
1497 print_signal_handler(st, SIGSEGV, buf, buflen);
1498 print_signal_handler(st, SIGBUS , buf, buflen);
1499 print_signal_handler(st, SIGFPE , buf, buflen);
1500 print_signal_handler(st, SIGPIPE, buf, buflen);
1501 print_signal_handler(st, SIGXFSZ, buf, buflen);
1502 print_signal_handler(st, SIGILL , buf, buflen);
1503 print_signal_handler(st, SR_signum, buf, buflen);
1504 print_signal_handler(st, SHUTDOWN1_SIGNAL, buf, buflen);
1505 print_signal_handler(st, SHUTDOWN2_SIGNAL , buf, buflen);
1506 print_signal_handler(st, SHUTDOWN3_SIGNAL , buf, buflen);
1507 print_signal_handler(st, BREAK_SIGNAL, buf, buflen);
1508 print_signal_handler(st, SIGTRAP, buf, buflen);
1509 // We also want to know if someone else adds a SIGDANGER handler because
|