< prev index next >

src/share/vm/gc/shared/gcId.cpp

Print this page

        

*** 45,54 **** --- 45,66 ---- const uint GCId::current_raw() { return currentNamedthread()->gc_id(); } + size_t GCId::print_prefix(char* buf, size_t len) { + if (Thread::current()->is_Named_thread()) { + uint gc_id = current_raw(); + if (gc_id != undefined()) { + int ret = jio_snprintf(buf, len, "GC#%u ", gc_id); + assert(ret > 0, "Failed to print prefix. Log buffer too small?"); + return (size_t)ret; + } + } + return 0; + } + GCIdMark::GCIdMark() : _gc_id(GCId::create()) { currentNamedthread()->set_gc_id(_gc_id); } GCIdMark::GCIdMark(uint gc_id) : _gc_id(gc_id) {
< prev index next >