Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 26a1841

Browse files
committedMay 29, 2020
8246134: ZGC: Restructure hs_err sections
Reviewed-by: pliden, eosterlund
1 parent 56b7960 commit 26a1841

File tree

6 files changed

+40
-16
lines changed

6 files changed

+40
-16
lines changed
 

‎src/hotspot/share/gc/z/zBarrierSet.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,7 @@ void ZBarrierSet::on_thread_detach(Thread* thread) {
9595
// Flush and free any remaining mark stacks
9696
ZHeap::heap()->mark_flush_and_free(thread);
9797
}
98+
99+
void ZBarrierSet::print_on(outputStream* st) const {
100+
st->print_cr("ZBarrierSet");
101+
}

‎src/hotspot/share/gc/z/zBarrierSet.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ZBarrierSet : public BarrierSet {
4040
virtual void on_thread_attach(Thread* thread);
4141
virtual void on_thread_detach(Thread* thread);
4242

43-
virtual void print_on(outputStream* st) const {}
43+
virtual void print_on(outputStream* st) const;
4444

4545
template <DecoratorSet decorators, typename BarrierSetT = ZBarrierSet>
4646
class AccessBarrier : public BarrierSet::AccessBarrier<decorators, BarrierSetT> {

‎src/hotspot/share/gc/z/zCollectedHeap.cpp

+17-13
Original file line numberDiff line numberDiff line change
@@ -305,20 +305,24 @@ void ZCollectedHeap::print_on(outputStream* st) const {
305305
}
306306

307307
void ZCollectedHeap::print_on_error(outputStream* st) const {
308+
st->print_cr("ZGC Globals:");
309+
st->print_cr(" GlobalPhase: %u (%s)", ZGlobalPhase, ZGlobalPhaseToString());
310+
st->print_cr(" GlobalSeqNum: %u", ZGlobalSeqNum);
311+
st->print_cr(" Offset Max: " SIZE_FORMAT "%s (" PTR_FORMAT ")",
312+
byte_size_in_exact_unit(ZAddressOffsetMax),
313+
exact_unit_for_byte_size(ZAddressOffsetMax),
314+
ZAddressOffsetMax);
315+
st->print_cr(" Page Size Small: " SIZE_FORMAT "M", ZPageSizeSmall / M);
316+
st->print_cr(" Page Size Medium: " SIZE_FORMAT "M", ZPageSizeMedium / M);
317+
st->cr();
318+
st->print_cr("ZGC Metadata Bits:");
319+
st->print_cr(" Good: " PTR_FORMAT, ZAddressGoodMask);
320+
st->print_cr(" Bad: " PTR_FORMAT, ZAddressBadMask);
321+
st->print_cr(" WeakBad: " PTR_FORMAT, ZAddressWeakBadMask);
322+
st->print_cr(" Marked: " PTR_FORMAT, ZAddressMetadataMarked);
323+
st->print_cr(" Remapped: " PTR_FORMAT, ZAddressMetadataRemapped);
324+
st->cr();
308325
CollectedHeap::print_on_error(st);
309-
310-
st->print_cr( "Heap");
311-
st->print_cr( " GlobalPhase: %u", ZGlobalPhase);
312-
st->print_cr( " GlobalSeqNum: %u", ZGlobalSeqNum);
313-
st->print_cr( " Offset Max: " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZAddressOffsetMax, ZAddressOffsetMax);
314-
st->print_cr( " Page Size Small: " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZPageSizeSmall, ZPageSizeSmall);
315-
st->print_cr( " Page Size Medium: " SIZE_FORMAT_W(-15) " (" PTR_FORMAT ")", ZPageSizeMedium, ZPageSizeMedium);
316-
st->print_cr( "Metadata Bits");
317-
st->print_cr( " Good: " PTR_FORMAT, ZAddressGoodMask);
318-
st->print_cr( " Bad: " PTR_FORMAT, ZAddressBadMask);
319-
st->print_cr( " WeakBad: " PTR_FORMAT, ZAddressWeakBadMask);
320-
st->print_cr( " Marked: " PTR_FORMAT, ZAddressMetadataMarked);
321-
st->print_cr( " Remapped: " PTR_FORMAT, ZAddressMetadataRemapped);
322326
}
323327

324328
void ZCollectedHeap::print_extended_on(outputStream* st) const {

‎src/hotspot/share/gc/z/zGlobals.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,19 @@ uintptr_t ZAddressMetadataMarked0;
5454
uintptr_t ZAddressMetadataMarked1;
5555
uintptr_t ZAddressMetadataRemapped;
5656
uintptr_t ZAddressMetadataFinalizable;
57+
58+
const char* ZGlobalPhaseToString() {
59+
switch (ZGlobalPhase) {
60+
case ZPhaseMark:
61+
return "Mark";
62+
63+
case ZPhaseMarkCompleted:
64+
return "MarkCompleted";
65+
66+
case ZPhaseRelocate:
67+
return "Relocate";
68+
69+
default:
70+
return "Unknown";
71+
}
72+
}

‎src/hotspot/share/gc/z/zGlobals.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ extern uint32_t ZGlobalPhase;
3636
const uint32_t ZPhaseMark = 0;
3737
const uint32_t ZPhaseMarkCompleted = 1;
3838
const uint32_t ZPhaseRelocate = 2;
39+
const char* ZGlobalPhaseToString();
3940

4041
// Global sequence number
4142
extern uint32_t ZGlobalSeqNum;

‎src/hotspot/share/gc/z/zHeap.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -505,15 +505,14 @@ void ZHeap::print_extended_on(outputStream* st) const {
505505
_page_allocator.enable_deferred_delete();
506506

507507
// Print all pages
508+
st->print_cr("ZGC Page Table:");
508509
ZPageTableIterator iter(&_page_table);
509510
for (ZPage* page; iter.next(&page);) {
510511
page->print_on(st);
511512
}
512513

513514
// Allow pages to be deleted
514515
_page_allocator.enable_deferred_delete();
515-
516-
st->cr();
517516
}
518517

519518
bool ZHeap::print_location(outputStream* st, uintptr_t addr) const {

0 commit comments

Comments
 (0)