Skip to content

Commit e906490

Browse files
committed
Fix print_container_info output
1 parent a93e88a commit e906490

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/hotspot/os/linux/os_linux.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,23 +2545,23 @@ bool os::Linux::print_container_info(outputStream* st) {
25452545
if (supported && i > 0) {
25462546
st->print_cr("%d", i);
25472547
} else {
2548-
st->print_cr("no quota or unavailable");
2548+
st->print_cr("%s", !supported ? "not supported" : "no quota");
25492549
}
25502550

25512551
supported = OSContainer::cpu_period(i);
25522552
st->print("cpu_period: ");
25532553
if (supported && i > 0) {
25542554
st->print_cr("%d", i);
25552555
} else {
2556-
st->print_cr("no period or unavailable");
2556+
st->print_cr("%s", !supported ? "not supported" : "no period");
25572557
}
25582558

25592559
supported = OSContainer::cpu_shares(i);
25602560
st->print("cpu_shares: ");
25612561
if (supported && i > 0) {
25622562
st->print_cr("%d", i);
25632563
} else {
2564-
st->print_cr("no shares or unavailable");
2564+
st->print_cr("%s", !supported ? "not supported" : "no shares");
25652565
}
25662566

25672567
uint64_t j = 0;
@@ -2570,7 +2570,7 @@ bool os::Linux::print_container_info(outputStream* st) {
25702570
if (supported && j > 0) {
25712571
st->print_cr(UINT64_FORMAT, j);
25722572
} else {
2573-
st->print_cr("unavailable");
2573+
st->print_cr("%s", !supported ? "not supported" : "no usage");
25742574
}
25752575

25762576
MetricResult memory_limit;
@@ -2629,15 +2629,15 @@ bool os::Linux::print_container_info(outputStream* st) {
26292629
if (supported && j > 0) {
26302630
st->print_cr(UINT64_FORMAT, j);
26312631
} else {
2632-
st->print_cr("unlimited or unavailable");
2632+
st->print_cr("%s", !supported ? "not supported" : "unlimited");
26332633
}
26342634

26352635
supported = OSContainer::pids_current(j);
26362636
st->print("current number of tasks: ");
26372637
if (supported && j > 0) {
26382638
st->print_cr(UINT64_FORMAT, j);
26392639
} else {
2640-
st->print_cr("unavailable");
2640+
st->print_cr("%s", !supported ? "not supported" : "no current tasks");
26412641
}
26422642

26432643
return true;

0 commit comments

Comments
 (0)