< prev index next >

src/hotspot/share/gc/z/zStat.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 27,36 **** --- 27,37 ---- #include "gc/z/zGlobals.hpp" #include "gc/z/zHeap.inline.hpp" #include "gc/z/zLargePages.inline.hpp" #include "gc/z/zNMethodTable.hpp" #include "gc/z/zNUMA.hpp" + #include "gc/z/zRelocationSetSelector.inline.hpp" #include "gc/z/zStat.hpp" #include "gc/z/zTracer.inline.hpp" #include "gc/z/zUtils.hpp" #include "memory/resourceArea.hpp" #include "runtime/atomic.hpp"
*** 39,54 **** #include "utilities/align.hpp" #include "utilities/compilerWarnings.hpp" #include "utilities/debug.hpp" #include "utilities/ticks.hpp" ! #define ZSIZE_FMT SIZE_FORMAT "M(%.0f%%)" ! #define ZSIZE_ARGS(size) ((size) / M), (percent_of(size, ZStatHeap::max_capacity())) ! ! #define ZTABLE_ARGS_NA "%9s", "-" ! #define ZTABLE_ARGS(size) SIZE_FORMAT_W(8) "M (%.0f%%)", \ ! ((size) / M), (percent_of(size, ZStatHeap::max_capacity())) // // Stat sampler/counter data // struct ZStatSamplerData { --- 40,56 ---- #include "utilities/align.hpp" #include "utilities/compilerWarnings.hpp" #include "utilities/debug.hpp" #include "utilities/ticks.hpp" ! #define ZSIZE_FMT SIZE_FORMAT "M(%.0f%%)" ! #define ZSIZE_ARGS_WITH_MAX(size, max) ((size) / M), (percent_of(size, max)) ! #define ZSIZE_ARGS(size) ZSIZE_ARGS_WITH_MAX(size, ZStatHeap::max_capacity()) ! ! #define ZTABLE_ARGS_NA "%9s", "-" ! #define ZTABLE_ARGS(size) SIZE_FORMAT_W(8) "M (%.0f%%)", \ ! ((size) / M), (percent_of(size, ZStatHeap::max_capacity())) // // Stat sampler/counter data // struct ZStatSamplerData {
*** 639,652 **** ZStatSample(_sampler, duration.value()); ZStatLoad::print(); ZStatMMU::print(); ZStatMark::print(); - ZStatRelocation::print(); ZStatNMethods::print(); ZStatMetaspace::print(); ZStatReferences::print(); ZStatHeap::print(); log_info(gc)("Garbage Collection (%s) " ZSIZE_FMT "->" ZSIZE_FMT, GCCause::to_string(ZCollectedHeap::heap()->gc_cause()), ZSIZE_ARGS(ZStatHeap::used_at_mark_start()), --- 641,654 ---- ZStatSample(_sampler, duration.value()); ZStatLoad::print(); ZStatMMU::print(); ZStatMark::print(); ZStatNMethods::print(); ZStatMetaspace::print(); ZStatReferences::print(); + ZStatRelocation::print(); ZStatHeap::print(); log_info(gc)("Garbage Collection (%s) " ZSIZE_FMT "->" ZSIZE_FMT, GCCause::to_string(ZCollectedHeap::heap()->gc_cause()), ZSIZE_ARGS(ZStatHeap::used_at_mark_start()),
*** 1124,1150 **** } // // Stat relocation // ! size_t ZStatRelocation::_relocating; ! bool ZStatRelocation::_success; ! ! void ZStatRelocation::set_at_select_relocation_set(size_t relocating) { ! _relocating = relocating; } void ZStatRelocation::set_at_relocate_end(bool success) { _success = success; } void ZStatRelocation::print() { ! if (_success) { ! log_info(gc, reloc)("Relocation: Successful, " SIZE_FORMAT "M relocated", _relocating / M); ! } else { ! log_info(gc, reloc)("Relocation: Incomplete"); ! } } // // Stat nmethods // --- 1126,1184 ---- } // // Stat relocation // ! ZStatRelocation::Group ZStatRelocation::_small; ! ZStatRelocation::Group ZStatRelocation::_medium; ! ZStatRelocation::Group ZStatRelocation::_large; ! bool ZStatRelocation::_success; ! ! void ZStatRelocation::set_at_select_relocation_set(const ZRelocationSetSelectorGroupStats& small, ! const ZRelocationSetSelectorGroupStats& medium, ! const ZRelocationSetSelectorGroupStats& large) { ! _small._npages = small.npages(); ! _small._total = small.total(); ! _small._empty = small.empty(); ! _small._compacting_from = small.compacting_from(); ! _small._compacting_to = small.compacting_to(); ! ! _medium._npages = medium.npages(); ! _medium._total = medium.total(); ! _medium._empty = medium.empty(); ! _medium._compacting_from = medium.compacting_from(); ! _medium._compacting_to = medium.compacting_to(); ! ! _large._npages = large.npages(); ! _large._total = large.total(); ! _large._empty = large.empty(); ! _large._compacting_from = large.compacting_from(); ! _large._compacting_to = large.compacting_to(); } void ZStatRelocation::set_at_relocate_end(bool success) { _success = success; } + void ZStatRelocation::print(const char* name, const ZStatRelocation::Group& group) { + const size_t total = _small._total + _medium._total + _large._total; + + log_info(gc, reloc)("%s Pages: " SIZE_FORMAT " / " ZSIZE_FMT ", Empty: " ZSIZE_FMT ", Compacting: " ZSIZE_FMT "->" ZSIZE_FMT, + name, + group._npages, + ZSIZE_ARGS_WITH_MAX(group._total, total), + ZSIZE_ARGS_WITH_MAX(group._empty, total), + ZSIZE_ARGS_WITH_MAX(group._compacting_from, total), + ZSIZE_ARGS_WITH_MAX(group._compacting_to, total)); + } + void ZStatRelocation::print() { ! print("Small", _small); ! print("Medium", _medium); ! print("Large", _large); ! ! log_info(gc, reloc)("Relocation: %s", _success ? "Successful" : "Incomplete"); } // // Stat nmethods //
*** 1276,1288 **** _at_mark_end.allocated = allocated; _at_mark_end.used = used; _at_mark_end.free = free(used); } ! void ZStatHeap::set_at_select_relocation_set(size_t live, ! size_t garbage, size_t reclaimed) { _at_mark_end.live = live; _at_mark_end.garbage = garbage; _at_relocate_start.garbage = garbage - reclaimed; _at_relocate_start.reclaimed = reclaimed; --- 1310,1326 ---- _at_mark_end.allocated = allocated; _at_mark_end.used = used; _at_mark_end.free = free(used); } ! void ZStatHeap::set_at_select_relocation_set(const ZRelocationSetSelectorGroupStats& small, ! const ZRelocationSetSelectorGroupStats& medium, ! const ZRelocationSetSelectorGroupStats& large, size_t reclaimed) { + const size_t live = small.live() + medium.live() + large.live(); + const size_t garbage = small.garbage() + medium.garbage() + large.garbage(); + _at_mark_end.live = live; _at_mark_end.garbage = garbage; _at_relocate_start.garbage = garbage - reclaimed; _at_relocate_start.reclaimed = reclaimed;
< prev index next >