Skip to content

Commit 8efd7aa

Browse files
committed
8328786: [AIX] move some important warnings/errors from trcVerbose to UL
Reviewed-by: lucy, stuefe
1 parent f26e430 commit 8efd7aa

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

src/hotspot/os/aix/libperfstat_aix.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "libperfstat_aix.hpp"
2828
#include "misc_aix.hpp"
29+
#include "logging/log.hpp"
2930
#include "runtime/os.hpp"
3031

3132
#include <dlfcn.h>
@@ -76,7 +77,7 @@ bool libperfstat::init() {
7677
char ebuf[512];
7778
g_libhandle = os::dll_load(libperfstat, ebuf, sizeof(ebuf));
7879
if (!g_libhandle) {
79-
trcVerbose("Cannot load %s (error: %s)", libperfstat, ebuf);
80+
log_warning(os)("Cannot load %s (error: %s)", libperfstat, ebuf);
8081
return false;
8182
}
8283

@@ -213,7 +214,7 @@ bool libperfstat::get_cpuinfo(cpuinfo_t* pci) {
213214

214215
if (-1 == libperfstat::perfstat_cpu_total(nullptr, &psct, sizeof(PERFSTAT_CPU_TOTAL_T_LATEST), 1)) {
215216
if (-1 == libperfstat::perfstat_cpu_total(nullptr, &psct, sizeof(perfstat_cpu_total_t_71), 1)) {
216-
trcVerbose("perfstat_cpu_total() failed (errno=%d)", errno);
217+
log_warning(os)("perfstat_cpu_total() failed (errno=%d)", errno);
217218
return false;
218219
}
219220
}
@@ -248,7 +249,7 @@ bool libperfstat::get_partitioninfo(partitioninfo_t* ppi) {
248249
if (-1 == libperfstat::perfstat_partition_total(nullptr, &pspt, sizeof(PERFSTAT_PARTITON_TOTAL_T_LATEST), 1)) {
249250
if (-1 == libperfstat::perfstat_partition_total(nullptr, &pspt, sizeof(perfstat_partition_total_t_71), 1)) {
250251
ame_details = false;
251-
trcVerbose("perfstat_partition_total() failed (errno=%d)", errno);
252+
log_warning(os)("perfstat_partition_total() failed (errno=%d)", errno);
252253
return false;
253254
}
254255
}
@@ -314,7 +315,7 @@ bool libperfstat::get_wparinfo(wparinfo_t* pwi) {
314315
memset (&pswt, '\0', sizeof(pswt));
315316

316317
if (-1 == libperfstat::perfstat_wpar_total(nullptr, &pswt, sizeof(PERFSTAT_WPAR_TOTAL_T_LATEST), 1)) {
317-
trcVerbose("perfstat_wpar_total() failed (errno=%d)", errno);
318+
log_warning(os)("perfstat_wpar_total() failed (errno=%d)", errno);
318319
return false;
319320
}
320321

src/hotspot/os/aix/loadlib_aix.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2012, 2019 SAP SE. All rights reserved.
2+
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2012, 2024 SAP SE. All rights reserved.
44
* Copyright (c) 2022, IBM Corp.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66
*
@@ -35,6 +35,7 @@
3535
#include "loadlib_aix.hpp"
3636
#include "misc_aix.hpp"
3737
#include "porting_aix.hpp"
38+
#include "logging/log.hpp"
3839
#include "utilities/debug.hpp"
3940
#include "utilities/ostream.hpp"
4041

@@ -194,7 +195,7 @@ static bool reload_table() {
194195
if (errno == ENOMEM) {
195196
buflen *= 2;
196197
} else {
197-
trcVerbose("loadquery failed (%d)", errno);
198+
log_warning(os)("loadquery failed (%d)", errno);
198199
goto cleanup;
199200
}
200201
} else {
@@ -211,7 +212,7 @@ static bool reload_table() {
211212

212213
loaded_module_t* lm = (loaded_module_t*) ::malloc(sizeof(loaded_module_t));
213214
if (!lm) {
214-
trcVerbose("OOM.");
215+
log_warning(os)("OOM.");
215216
goto cleanup;
216217
}
217218

@@ -224,7 +225,7 @@ static bool reload_table() {
224225

225226
lm->path = g_stringlist.add(ldi->ldinfo_filename);
226227
if (!lm->path) {
227-
trcVerbose("OOM.");
228+
log_warning(os)("OOM.");
228229
free(lm);
229230
goto cleanup;
230231
}
@@ -246,7 +247,7 @@ static bool reload_table() {
246247
if (*p_mbr_name) {
247248
lm->member = g_stringlist.add(p_mbr_name);
248249
if (!lm->member) {
249-
trcVerbose("OOM.");
250+
log_warning(os)("OOM.");
250251
free(lm);
251252
goto cleanup;
252253
}

src/hotspot/os/aix/os_aix.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ size_t os::Aix::query_pagesize(void* addr) {
347347
if (::vmgetinfo(&pi, VM_PAGE_INFO, sizeof(pi)) == 0) {
348348
return pi.pagesize;
349349
} else {
350-
trcVerbose("vmgetinfo(VM_PAGE_INFO) failed (errno: %d)", errno);
350+
log_warning(pagesize)("vmgetinfo(VM_PAGE_INFO) failed (errno: %d)", errno);
351351
assert(false, "vmgetinfo failed to retrieve page size");
352352
return 4*K;
353353
}
@@ -442,14 +442,13 @@ static void query_multipage_support() {
442442
psize_t sizes[MAX_PAGE_SIZES];
443443
const int num_psizes = ::vmgetinfo(sizes, VMINFO_GETPSIZES, MAX_PAGE_SIZES);
444444
if (num_psizes == -1) {
445-
trcVerbose("vmgetinfo(VMINFO_GETPSIZES) failed (errno: %d)", errno);
446-
trcVerbose("disabling multipage support.");
445+
log_warning(pagesize)("vmgetinfo(VMINFO_GETPSIZES) failed (errno: %d), disabling multipage support.", errno);
447446
g_multipage_support.error = ERROR_MP_VMGETINFO_FAILED;
448447
goto query_multipage_support_end;
449448
}
450449
guarantee(num_psizes > 0, "vmgetinfo(.., VMINFO_GETPSIZES, ...) failed.");
451450
assert(num_psizes <= MAX_PAGE_SIZES, "Surprise! more than 4 page sizes?");
452-
trcVerbose("vmgetinfo(.., VMINFO_GETPSIZES, ...) returns %d supported page sizes: ", num_psizes);
451+
log_info(pagesize)("vmgetinfo(.., VMINFO_GETPSIZES, ...) returns %d supported page sizes: ", num_psizes);
453452
for (int i = 0; i < num_psizes; i ++) {
454453
trcVerbose(" %s ", describe_pagesize(sizes[i]));
455454
}
@@ -471,15 +470,15 @@ static void query_multipage_support() {
471470
if (::shmctl(shmid, SHM_PAGESIZE, &shm_buf) != 0) {
472471
const int en = errno;
473472
::shmctl(shmid, IPC_RMID, nullptr); // As early as possible!
474-
trcVerbose("shmctl(SHM_PAGESIZE) failed with errno=%d", errno);
473+
log_warning(pagesize)("shmctl(SHM_PAGESIZE) failed with errno=%d", errno);
475474
} else {
476475
// Attach and double check pageisze.
477476
void* p = ::shmat(shmid, nullptr, 0);
478477
::shmctl(shmid, IPC_RMID, nullptr); // As early as possible!
479478
guarantee0(p != (void*) -1); // Should always work.
480479
const size_t real_pagesize = os::Aix::query_pagesize(p);
481480
if (real_pagesize != pagesize) {
482-
trcVerbose("real page size (" SIZE_FORMAT_X ") differs.", real_pagesize);
481+
log_warning(pagesize)("real page size (" SIZE_FORMAT_X ") differs.", real_pagesize);
483482
} else {
484483
can_use = true;
485484
}
@@ -609,7 +608,7 @@ bool os::Aix::get_meminfo(meminfo_t* pmi) {
609608
memset (&psmt, '\0', sizeof(psmt));
610609
const int rc = libperfstat::perfstat_memory_total(nullptr, &psmt, sizeof(psmt), 1);
611610
if (rc == -1) {
612-
trcVerbose("perfstat_memory_total() failed (errno=%d)", errno);
611+
log_warning(os)("perfstat_memory_total() failed (errno=%d)", errno);
613612
assert(0, "perfstat_memory_total() failed");
614613
return false;
615614
}
@@ -1601,7 +1600,7 @@ static bool uncommit_shmated_memory(char* addr, size_t size) {
16011600
const bool rc = my_disclaim64(addr, size);
16021601

16031602
if (!rc) {
1604-
trcVerbose("my_disclaim64(" PTR_FORMAT ", " UINTX_FORMAT ") failed.\n", p2i(addr), size);
1603+
log_warning(os)("my_disclaim64(" PTR_FORMAT ", " UINTX_FORMAT ") failed.\n", p2i(addr), size);
16051604
return false;
16061605
}
16071606
return true;
@@ -1791,7 +1790,7 @@ bool os::pd_commit_memory(char* addr, size_t size, bool exec) {
17911790
guarantee0(vmi);
17921791
vmi->assert_is_valid_subrange(addr, size);
17931792

1794-
trcVerbose("commit_memory [" PTR_FORMAT " - " PTR_FORMAT "].", p2i(addr), p2i(addr + size - 1));
1793+
log_info(os)("commit_memory [" PTR_FORMAT " - " PTR_FORMAT "].", p2i(addr), p2i(addr + size - 1));
17951794

17961795
if (UseExplicitCommit) {
17971796
// AIX commits memory on touch. So, touch all pages to be committed.
@@ -2171,7 +2170,7 @@ OSReturn os::set_native_priority(Thread* thread, int newpri) {
21712170
int ret = pthread_setschedparam(thr, policy, &param);
21722171

21732172
if (ret != 0) {
2174-
trcVerbose("Could not change priority for thread %d to %d (error %d, %s)",
2173+
log_warning(os)("Could not change priority for thread %d to %d (error %d, %s)",
21752174
(int)thr, newpri, ret, os::errno_name(ret));
21762175
}
21772176
return (ret == 0) ? OS_OK : OS_ERR;
@@ -2664,10 +2663,10 @@ void os::Aix::initialize_os_info() {
26642663
memset(&uts, 0, sizeof(uts));
26652664
strcpy(uts.sysname, "?");
26662665
if (::uname(&uts) == -1) {
2667-
trcVerbose("uname failed (%d)", errno);
2666+
log_warning(os)("uname failed (%d)", errno);
26682667
guarantee(0, "Could not determine uname information");
26692668
} else {
2670-
trcVerbose("uname says: sysname \"%s\" version \"%s\" release \"%s\" "
2669+
log_info(os)("uname says: sysname \"%s\" version \"%s\" release \"%s\" "
26712670
"node \"%s\" machine \"%s\"\n",
26722671
uts.sysname, uts.version, uts.release, uts.nodename, uts.machine);
26732672
const int major = atoi(uts.version);
@@ -2683,7 +2682,7 @@ void os::Aix::initialize_os_info() {
26832682
// Determine detailed AIX version: Version, Release, Modification, Fix Level.
26842683
odmWrapper::determine_os_kernel_version(&_os_version);
26852684
if (os_version_short() < 0x0701) {
2686-
trcVerbose("AIX releases older than AIX 7.1 are not supported.");
2685+
log_warning(os)("AIX releases older than AIX 7.1 are not supported.");
26872686
assert(false, "AIX release too old.");
26882687
}
26892688
name_str = "AIX";
@@ -2692,7 +2691,7 @@ void os::Aix::initialize_os_info() {
26922691
} else {
26932692
assert(false, "%s", name_str);
26942693
}
2695-
trcVerbose("We run on %s %s", name_str, ver_str);
2694+
log_info(os)("We run on %s %s", name_str, ver_str);
26962695
}
26972696

26982697
guarantee(_os_version, "Could not determine AIX release");
@@ -2717,7 +2716,7 @@ void os::Aix::scan_environment() {
27172716
trcVerbose("EXTSHM=%s.", p ? p : "<unset>");
27182717
if (p && strcasecmp(p, "ON") == 0) {
27192718
_extshm = 1;
2720-
trcVerbose("*** Unsupported mode! Please remove EXTSHM from your environment! ***");
2719+
log_warning(os)("*** Unsupported mode! Please remove EXTSHM from your environment! ***");
27212720
if (!AllowExtshm) {
27222721
// We allow under certain conditions the user to continue. However, we want this
27232722
// to be a fatal error by default. On certain AIX systems, leaving EXTSHM=ON means
@@ -2741,7 +2740,7 @@ void os::Aix::scan_environment() {
27412740
trcVerbose("XPG_SUS_ENV=%s.", p ? p : "<unset>");
27422741
if (p && strcmp(p, "ON") == 0) {
27432742
_xpg_sus_mode = 1;
2744-
trcVerbose("Unsupported setting: XPG_SUS_ENV=ON");
2743+
log_warning(os)("Unsupported setting: XPG_SUS_ENV=ON");
27452744
// This is not supported. Worst of all, it changes behaviour of mmap MAP_FIXED to
27462745
// clobber address ranges. If we ever want to support that, we have to do some
27472746
// testing first.
@@ -2760,7 +2759,7 @@ void os::Aix::scan_environment() {
27602759

27612760
void os::Aix::initialize_libperfstat() {
27622761
if (!libperfstat::init()) {
2763-
trcVerbose("libperfstat initialization failed.");
2762+
log_warning(os)("libperfstat initialization failed.");
27642763
assert(false, "libperfstat initialization failed");
27652764
} else {
27662765
trcVerbose("libperfstat initialized.");

0 commit comments

Comments
 (0)