提交 69240aab 编写于 作者: S stefank

8011872: Include Bit Map addresses in the hs_err files

Reviewed-by: brutisso, jmasa
上级 5ae8940b
...@@ -2809,6 +2809,23 @@ bool CMSCollector::is_cms_reachable(HeapWord* addr) { ...@@ -2809,6 +2809,23 @@ bool CMSCollector::is_cms_reachable(HeapWord* addr) {
} }
} }
void
CMSCollector::print_on_error(outputStream* st) {
CMSCollector* collector = ConcurrentMarkSweepGeneration::_collector;
if (collector != NULL) {
CMSBitMap* bitmap = &collector->_markBitMap;
st->print_cr("Marking Bits: (CMSBitMap*) " PTR_FORMAT, bitmap);
bitmap->print_on_error(st, " Bits: ");
st->cr();
CMSBitMap* mut_bitmap = &collector->_modUnionTable;
st->print_cr("Mod Union Table: (CMSBitMap*) " PTR_FORMAT, mut_bitmap);
mut_bitmap->print_on_error(st, " Bits: ");
}
}
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// CMS Verification Support // CMS Verification Support
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
...@@ -6531,6 +6548,10 @@ void CMSBitMap::dirty_range_iterate_clear(MemRegion mr, MemRegionClosure* cl) { ...@@ -6531,6 +6548,10 @@ void CMSBitMap::dirty_range_iterate_clear(MemRegion mr, MemRegionClosure* cl) {
} }
} }
void CMSBitMap::print_on_error(outputStream* st, const char* prefix) const {
_bm.print_on_error(st, prefix);
}
#ifndef PRODUCT #ifndef PRODUCT
void CMSBitMap::assert_locked() const { void CMSBitMap::assert_locked() const {
CMSLockVerifier::assert_locked(lock()); CMSLockVerifier::assert_locked(lock());
......
...@@ -151,6 +151,8 @@ class CMSBitMap VALUE_OBJ_CLASS_SPEC { ...@@ -151,6 +151,8 @@ class CMSBitMap VALUE_OBJ_CLASS_SPEC {
size_t heapWordToOffset(HeapWord* addr) const; size_t heapWordToOffset(HeapWord* addr) const;
size_t heapWordDiffToOffsetDiff(size_t diff) const; size_t heapWordDiffToOffsetDiff(size_t diff) const;
void print_on_error(outputStream* st, const char* prefix) const;
// debugging // debugging
// is this address range covered by the bit-map? // is this address range covered by the bit-map?
NOT_PRODUCT( NOT_PRODUCT(
...@@ -984,6 +986,8 @@ class CMSCollector: public CHeapObj<mtGC> { ...@@ -984,6 +986,8 @@ class CMSCollector: public CHeapObj<mtGC> {
CMSAdaptiveSizePolicy* size_policy(); CMSAdaptiveSizePolicy* size_policy();
CMSGCAdaptivePolicyCounters* gc_adaptive_policy_counters(); CMSGCAdaptivePolicyCounters* gc_adaptive_policy_counters();
static void print_on_error(outputStream* st);
// debugging // debugging
void verify(); void verify();
bool verify_after_remark(); bool verify_after_remark();
......
...@@ -101,6 +101,10 @@ bool CMBitMapRO::covers(ReservedSpace heap_rs) const { ...@@ -101,6 +101,10 @@ bool CMBitMapRO::covers(ReservedSpace heap_rs) const {
} }
#endif #endif
void CMBitMapRO::print_on_error(outputStream* st, const char* prefix) const {
_bm.print_on_error(st, prefix);
}
bool CMBitMap::allocate(ReservedSpace heap_rs) { bool CMBitMap::allocate(ReservedSpace heap_rs) {
_bmStartWord = (HeapWord*)(heap_rs.base()); _bmStartWord = (HeapWord*)(heap_rs.base());
_bmWordSize = heap_rs.size()/HeapWordSize; // heap_rs.size() is in bytes _bmWordSize = heap_rs.size()/HeapWordSize; // heap_rs.size() is in bytes
...@@ -3277,6 +3281,13 @@ void ConcurrentMark::print_worker_threads_on(outputStream* st) const { ...@@ -3277,6 +3281,13 @@ void ConcurrentMark::print_worker_threads_on(outputStream* st) const {
} }
} }
void ConcurrentMark::print_on_error(outputStream* st) const {
st->print_cr("Marking Bits (Prev, Next): (CMBitMap*) " PTR_FORMAT ", (CMBitMap*) " PTR_FORMAT,
_prevMarkBitMap, _nextMarkBitMap);
_prevMarkBitMap->print_on_error(st, " Prev Bits: ");
_nextMarkBitMap->print_on_error(st, " Next Bits: ");
}
// We take a break if someone is trying to stop the world. // We take a break if someone is trying to stop the world.
bool ConcurrentMark::do_yield_check(uint worker_id) { bool ConcurrentMark::do_yield_check(uint worker_id) {
if (should_yield()) { if (should_yield()) {
......
...@@ -113,6 +113,8 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC { ...@@ -113,6 +113,8 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
return res; return res;
} }
void print_on_error(outputStream* st, const char* prefix) const;
// debugging // debugging
NOT_PRODUCT(bool covers(ReservedSpace rs) const;) NOT_PRODUCT(bool covers(ReservedSpace rs) const;)
}; };
...@@ -829,6 +831,8 @@ public: ...@@ -829,6 +831,8 @@ public:
void print_worker_threads_on(outputStream* st) const; void print_worker_threads_on(outputStream* st) const;
void print_on_error(outputStream* st) const;
// The following indicate whether a given verbose level has been // The following indicate whether a given verbose level has been
// set. Notice that anything above stats is conditional to // set. Notice that anything above stats is conditional to
// _MARKING_VERBOSE_ having been set to 1 // _MARKING_VERBOSE_ having been set to 1
......
...@@ -3427,6 +3427,15 @@ void G1CollectedHeap::print_extended_on(outputStream* st) const { ...@@ -3427,6 +3427,15 @@ void G1CollectedHeap::print_extended_on(outputStream* st) const {
heap_region_iterate(&blk); heap_region_iterate(&blk);
} }
void G1CollectedHeap::print_on_error(outputStream* st) const {
this->CollectedHeap::print_on_error(st);
if (_cm != NULL) {
st->cr();
_cm->print_on_error(st);
}
}
void G1CollectedHeap::print_gc_threads_on(outputStream* st) const { void G1CollectedHeap::print_gc_threads_on(outputStream* st) const {
if (G1CollectedHeap::use_parallel_gc_threads()) { if (G1CollectedHeap::use_parallel_gc_threads()) {
workers()->print_worker_threads_on(st); workers()->print_worker_threads_on(st);
......
...@@ -1575,6 +1575,7 @@ public: ...@@ -1575,6 +1575,7 @@ public:
virtual void verify(bool silent); virtual void verify(bool silent);
virtual void print_on(outputStream* st) const; virtual void print_on(outputStream* st) const;
virtual void print_extended_on(outputStream* st) const; virtual void print_extended_on(outputStream* st) const;
virtual void print_on_error(outputStream* st) const;
virtual void print_gc_threads_on(outputStream* st) const; virtual void print_gc_threads_on(outputStream* st) const;
virtual void gc_threads_do(ThreadClosure* tc) const; virtual void gc_threads_do(ThreadClosure* tc) const;
......
...@@ -173,6 +173,12 @@ public: ...@@ -173,6 +173,12 @@ public:
void reset_counters(); void reset_counters();
#endif // #ifndef PRODUCT #endif // #ifndef PRODUCT
void print_on_error(outputStream* st) const {
st->print_cr("Marking Bits: (ParMarkBitMap*) " PTR_FORMAT, this);
_beg_bits.print_on_error(st, " Begin Bits: ");
_end_bits.print_on_error(st, " End Bits: ");
}
#ifdef ASSERT #ifdef ASSERT
void verify_clear() const; void verify_clear() const;
inline void verify_bit(idx_t bit) const; inline void verify_bit(idx_t bit) const;
......
...@@ -648,6 +648,15 @@ void ParallelScavengeHeap::print_on(outputStream* st) const { ...@@ -648,6 +648,15 @@ void ParallelScavengeHeap::print_on(outputStream* st) const {
MetaspaceAux::print_on(st); MetaspaceAux::print_on(st);
} }
void ParallelScavengeHeap::print_on_error(outputStream* st) const {
this->CollectedHeap::print_on_error(st);
if (UseParallelOldGC) {
st->cr();
PSParallelCompact::print_on_error(st);
}
}
void ParallelScavengeHeap::gc_threads_do(ThreadClosure* tc) const { void ParallelScavengeHeap::gc_threads_do(ThreadClosure* tc) const {
PSScavenge::gc_task_manager()->threads_do(tc); PSScavenge::gc_task_manager()->threads_do(tc);
} }
......
...@@ -220,6 +220,7 @@ class ParallelScavengeHeap : public CollectedHeap { ...@@ -220,6 +220,7 @@ class ParallelScavengeHeap : public CollectedHeap {
void prepare_for_verify(); void prepare_for_verify();
virtual void print_on(outputStream* st) const; virtual void print_on(outputStream* st) const;
virtual void print_on_error(outputStream* st) const;
virtual void print_gc_threads_on(outputStream* st) const; virtual void print_gc_threads_on(outputStream* st) const;
virtual void gc_threads_do(ThreadClosure* tc) const; virtual void gc_threads_do(ThreadClosure* tc) const;
virtual void print_tracing_info() const; virtual void print_tracing_info() const;
......
...@@ -165,6 +165,10 @@ void SplitInfo::verify_clear() ...@@ -165,6 +165,10 @@ void SplitInfo::verify_clear()
#endif // #ifdef ASSERT #endif // #ifdef ASSERT
void PSParallelCompact::print_on_error(outputStream* st) {
_mark_bitmap.print_on_error(st);
}
#ifndef PRODUCT #ifndef PRODUCT
const char* PSParallelCompact::space_names[] = { const char* PSParallelCompact::space_names[] = {
"old ", "eden", "from", "to " "old ", "eden", "from", "to "
......
...@@ -1163,6 +1163,8 @@ class PSParallelCompact : AllStatic { ...@@ -1163,6 +1163,8 @@ class PSParallelCompact : AllStatic {
// Time since last full gc (in milliseconds). // Time since last full gc (in milliseconds).
static jlong millis_since_last_gc(); static jlong millis_since_last_gc();
static void print_on_error(outputStream* st);
#ifndef PRODUCT #ifndef PRODUCT
// Debugging support. // Debugging support.
static const char* space_names[last_space_id]; static const char* space_names[last_space_id];
......
...@@ -567,6 +567,14 @@ class CollectedHeap : public CHeapObj<mtInternal> { ...@@ -567,6 +567,14 @@ class CollectedHeap : public CHeapObj<mtInternal> {
print_on(st); print_on(st);
} }
virtual void print_on_error(outputStream* st) const {
st->print_cr("Heap:");
print_extended_on(st);
st->cr();
_barrier_set->print_on(st);
}
// Print all GC threads (other than the VM thread) // Print all GC threads (other than the VM thread)
// used by this heap. // used by this heap.
virtual void print_gc_threads_on(outputStream* st) const = 0; virtual void print_gc_threads_on(outputStream* st) const = 0;
......
...@@ -1133,6 +1133,17 @@ void GenCollectedHeap::print_gc_threads_on(outputStream* st) const { ...@@ -1133,6 +1133,17 @@ void GenCollectedHeap::print_gc_threads_on(outputStream* st) const {
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
} }
void GenCollectedHeap::print_on_error(outputStream* st) const {
this->CollectedHeap::print_on_error(st);
#if INCLUDE_ALL_GCS
if (UseConcMarkSweepGC) {
st->cr();
CMSCollector::print_on_error(st);
}
#endif // INCLUDE_ALL_GCS
}
void GenCollectedHeap::print_tracing_info() const { void GenCollectedHeap::print_tracing_info() const {
if (TraceGen0Time) { if (TraceGen0Time) {
get_gen(0)->print_summary_info(); get_gen(0)->print_summary_info();
......
...@@ -344,6 +344,7 @@ public: ...@@ -344,6 +344,7 @@ public:
virtual void print_gc_threads_on(outputStream* st) const; virtual void print_gc_threads_on(outputStream* st) const;
virtual void gc_threads_do(ThreadClosure* tc) const; virtual void gc_threads_do(ThreadClosure* tc) const;
virtual void print_tracing_info() const; virtual void print_tracing_info() const;
virtual void print_on_error(outputStream* st) const;
// PrintGC, PrintGCDetails support // PrintGC, PrintGCDetails support
void print_heap_change(size_t prev_used) const; void print_heap_change(size_t prev_used) const;
......
...@@ -516,6 +516,10 @@ BitMap::idx_t BitMap::count_one_bits() const { ...@@ -516,6 +516,10 @@ BitMap::idx_t BitMap::count_one_bits() const {
return sum; return sum;
} }
void BitMap::print_on_error(outputStream* st, const char* prefix) const {
st->print_cr("%s[" PTR_FORMAT ", " PTR_FORMAT ")",
prefix, map(), (char*)map() + (size() >> LogBitsPerByte));
}
#ifndef PRODUCT #ifndef PRODUCT
......
...@@ -262,6 +262,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC { ...@@ -262,6 +262,7 @@ class BitMap VALUE_OBJ_CLASS_SPEC {
bool is_full() const; bool is_full() const;
bool is_empty() const; bool is_empty() const;
void print_on_error(outputStream* st, const char* prefix) const;
#ifndef PRODUCT #ifndef PRODUCT
public: public:
......
...@@ -685,13 +685,7 @@ void VMError::report(outputStream* st) { ...@@ -685,13 +685,7 @@ void VMError::report(outputStream* st) {
STEP(190, "(printing heap information)" ) STEP(190, "(printing heap information)" )
if (_verbose && Universe::is_fully_initialized()) { if (_verbose && Universe::is_fully_initialized()) {
// Print heap information before vm abort. As we'd like as much Universe::heap()->print_on_error(st);
// information as possible in the report we ask for the
// extended (i.e., more detailed) version.
Universe::print_on(st, true /* extended */);
st->cr();
Universe::heap()->barrier_set()->print_on(st);
st->cr(); st->cr();
st->print_cr("Polling page: " INTPTR_FORMAT, os::get_polling_page()); st->print_cr("Polling page: " INTPTR_FORMAT, os::get_polling_page());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册