annotate src/share/vm/gc_implementation/g1/g1RemSetSummary.hpp @ 4769:e72f7eecc96d

8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen Summary: Fixed the output of G1SummarizeRSetStats: too small datatype for the number of concurrently processed cards, added concurrent remembered set thread time retrieval for Linux and Windows (BSD uses os::elapsedTime() now), and other cleanup. The information presented during VM operation is now relative to the previous output, not always cumulative if G1SummarizeRSetStatsPeriod > 0. At VM exit, the code prints a cumulative summary. Reviewed-by: johnc, jwilhelm
author tschatzl
date Tue, 28 May 2013 09:32:06 +0200
parents
children 7ec10139bf37
rev   line source
tschatzl@4769 1 /*
tschatzl@4769 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
tschatzl@4769 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
tschatzl@4769 4 *
tschatzl@4769 5 * This code is free software; you can redistribute it and/or modify it
tschatzl@4769 6 * under the terms of the GNU General Public License version 2 only, as
tschatzl@4769 7 * published by the Free Software Foundation.
tschatzl@4769 8 *
tschatzl@4769 9 * This code is distributed in the hope that it will be useful, but WITHOUT
tschatzl@4769 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
tschatzl@4769 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
tschatzl@4769 12 * version 2 for more details (a copy is included in the LICENSE file that
tschatzl@4769 13 * accompanied this code).
tschatzl@4769 14 *
tschatzl@4769 15 * You should have received a copy of the GNU General Public License version
tschatzl@4769 16 * 2 along with this work; if not, write to the Free Software Foundation,
tschatzl@4769 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
tschatzl@4769 18 *
tschatzl@4769 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
tschatzl@4769 20 * or visit www.oracle.com if you need additional information or have any
tschatzl@4769 21 * questions.
tschatzl@4769 22 *
tschatzl@4769 23 */
tschatzl@4769 24
tschatzl@4769 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSETSUMMARY_HPP
tschatzl@4769 26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSETSUMMARY_HPP
tschatzl@4769 27
tschatzl@4769 28 #include "utilities/ostream.hpp"
tschatzl@4769 29
tschatzl@4769 30 class G1RemSet;
tschatzl@4769 31
tschatzl@4769 32 // A G1RemSetSummary manages statistical information about the G1RemSet
tschatzl@4769 33
tschatzl@4769 34 class G1RemSetSummary VALUE_OBJ_CLASS_SPEC {
tschatzl@4769 35 private:
tschatzl@4769 36 friend class GetRSThreadVTimeClosure;
tschatzl@4769 37
tschatzl@4769 38 G1RemSet* _remset;
tschatzl@4769 39
tschatzl@4769 40 G1RemSet* remset() const {
tschatzl@4769 41 return _remset;
tschatzl@4769 42 }
tschatzl@4769 43
tschatzl@4769 44 size_t _num_refined_cards;
tschatzl@4769 45 size_t _num_processed_buf_mutator;
tschatzl@4769 46 size_t _num_processed_buf_rs_threads;
tschatzl@4769 47
tschatzl@4769 48 size_t _num_coarsenings;
tschatzl@4769 49
tschatzl@4769 50 double* _rs_threads_vtimes;
tschatzl@4769 51 size_t _num_vtimes;
tschatzl@4769 52
tschatzl@4769 53 double _sampling_thread_vtime;
tschatzl@4769 54
tschatzl@4769 55 void set_rs_thread_vtime(uint thread, double value);
tschatzl@4769 56 void set_sampling_thread_vtime(double value) {
tschatzl@4769 57 _sampling_thread_vtime = value;
tschatzl@4769 58 }
tschatzl@4769 59
tschatzl@4769 60 void free_and_null() {
tschatzl@4769 61 if (_rs_threads_vtimes) {
tschatzl@4769 62 FREE_C_HEAP_ARRAY(double, _rs_threads_vtimes, mtGC);
tschatzl@4769 63 _rs_threads_vtimes = NULL;
tschatzl@4769 64 _num_vtimes = 0;
tschatzl@4769 65 }
tschatzl@4769 66 }
tschatzl@4769 67
tschatzl@4769 68 // update this summary with current data from various places
tschatzl@4769 69 void update();
tschatzl@4769 70
tschatzl@4769 71 public:
tschatzl@4769 72 G1RemSetSummary() : _remset(NULL), _num_refined_cards(0),
tschatzl@4769 73 _num_processed_buf_mutator(0), _num_processed_buf_rs_threads(0), _num_coarsenings(0),
tschatzl@4769 74 _rs_threads_vtimes(NULL), _num_vtimes(0), _sampling_thread_vtime(0.0f) {
tschatzl@4769 75 }
tschatzl@4769 76
tschatzl@4769 77 ~G1RemSetSummary() {
tschatzl@4769 78 free_and_null();
tschatzl@4769 79 }
tschatzl@4769 80
tschatzl@4769 81 // set the counters in this summary to the values of the others
tschatzl@4769 82 void set(G1RemSetSummary* other);
tschatzl@4769 83 // subtract all counters from the other summary, and set them in the current
tschatzl@4769 84 void subtract_from(G1RemSetSummary* other);
tschatzl@4769 85
tschatzl@4769 86 // initialize and get the first sampling
tschatzl@4769 87 void initialize(G1RemSet* remset, uint num_workers);
tschatzl@4769 88
tschatzl@4769 89 void print_on(outputStream* out);
tschatzl@4769 90
tschatzl@4769 91 double rs_thread_vtime(uint thread) const;
tschatzl@4769 92
tschatzl@4769 93 double sampling_thread_vtime() const {
tschatzl@4769 94 return _sampling_thread_vtime;
tschatzl@4769 95 }
tschatzl@4769 96
tschatzl@4769 97 size_t num_concurrent_refined_cards() const {
tschatzl@4769 98 return _num_refined_cards;
tschatzl@4769 99 }
tschatzl@4769 100
tschatzl@4769 101 size_t num_processed_buf_mutator() const {
tschatzl@4769 102 return _num_processed_buf_mutator;
tschatzl@4769 103 }
tschatzl@4769 104
tschatzl@4769 105 size_t num_processed_buf_rs_threads() const {
tschatzl@4769 106 return _num_processed_buf_rs_threads;
tschatzl@4769 107 }
tschatzl@4769 108
tschatzl@4769 109 size_t num_processed_buf_total() const {
tschatzl@4769 110 return num_processed_buf_mutator() + num_processed_buf_rs_threads();
tschatzl@4769 111 }
tschatzl@4769 112
tschatzl@4769 113 size_t num_coarsenings() const {
tschatzl@4769 114 return _num_coarsenings;
tschatzl@4769 115 }
tschatzl@4769 116 };
tschatzl@4769 117
tschatzl@4769 118 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1REMSETSUMMARY_HPP