annotate src/hotspot/share/gc/shenandoah/shenandoahHeapRegionCounters.hpp @ 54526:ee29b516a36a

revert changes
author jlaskey
date Wed, 23 Jan 2019 16:09:20 -0400
parents 9c18c9d839d3
children
rev   line source
rkennke@53962 1 /*
rkennke@53962 2 * Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
rkennke@53962 3 *
rkennke@53962 4 * This code is free software; you can redistribute it and/or modify it
rkennke@53962 5 * under the terms of the GNU General Public License version 2 only, as
rkennke@53962 6 * published by the Free Software Foundation.
rkennke@53962 7 *
rkennke@53962 8 * This code is distributed in the hope that it will be useful, but WITHOUT
rkennke@53962 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rkennke@53962 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
rkennke@53962 11 * version 2 for more details (a copy is included in the LICENSE file that
rkennke@53962 12 * accompanied this code).
rkennke@53962 13 *
rkennke@53962 14 * You should have received a copy of the GNU General Public License version
rkennke@53962 15 * 2 along with this work; if not, write to the Free Software Foundation,
rkennke@53962 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rkennke@53962 17 *
rkennke@53962 18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
rkennke@53962 19 * or visit www.oracle.com if you need additional information or have any
rkennke@53962 20 * questions.
rkennke@53962 21 *
rkennke@53962 22 */
rkennke@53962 23
coleenp@54304 24 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
coleenp@54304 25 #define SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP
rkennke@53962 26
rkennke@53962 27 #include "memory/allocation.hpp"
rkennke@53962 28
rkennke@53962 29 /**
rkennke@53962 30 * This provides the following in JVMStat:
rkennke@53962 31 *
rkennke@53962 32 * constants:
rkennke@53962 33 * - sun.gc.shenandoah.regions.timestamp the timestamp for this sample
rkennke@53962 34 * - sun.gc.shenandoah.regions.max_regions maximum number of regions
rkennke@53962 35 * - sun.gc.shenandoah.regions.region_size size per region, in kilobytes
rkennke@53962 36 *
rkennke@53962 37 * variables:
rkennke@53962 38 * - sun.gc.shenandoah.regions.status current GC status:
rkennke@53962 39 * - bit 0 set when marking in progress
rkennke@53962 40 * - bit 1 set when evacuation in progress
rkennke@53962 41 * - bit 2 set when update refs in progress
rkennke@53962 42 * - bit 3 set when traversal in progress
rkennke@53962 43 *
rkennke@53962 44 * two variable counters per region, with $max_regions (see above) counters:
rkennke@53962 45 * - sun.gc.shenandoah.regions.region.$i.data
rkennke@53962 46 * where $ is the region number from 0 <= i < $max_regions
rkennke@53962 47 *
rkennke@53962 48 * .data is in the following format:
rkennke@53962 49 * - bits 0-6 used memory in percent
rkennke@53962 50 * - bits 7-13 live memory in percent
rkennke@53962 51 * - bits 14-20 tlab allocated memory in percent
rkennke@53962 52 * - bits 21-27 gclab allocated memory in percent
rkennke@53962 53 * - bits 28-34 shared allocated memory in percent
rkennke@53962 54 * - bits 35-41 <reserved>
rkennke@53962 55 * - bits 42-50 <reserved>
rkennke@53962 56 * - bits 51-57 <reserved>
rkennke@53962 57 * - bits 58-63 status
rkennke@53962 58 * - bits describe the state as recorded in ShenandoahHeapRegion
rkennke@53962 59 */
rkennke@53962 60 class ShenandoahHeapRegionCounters : public CHeapObj<mtGC> {
rkennke@53962 61 private:
rkennke@53962 62 static const jlong PERCENT_MASK = 0x7f;
rkennke@53962 63 static const jlong STATUS_MASK = 0x3f;
rkennke@53962 64
rkennke@53962 65 static const jlong USED_SHIFT = 0;
rkennke@53962 66 static const jlong LIVE_SHIFT = 7;
rkennke@53962 67 static const jlong TLAB_SHIFT = 14;
rkennke@53962 68 static const jlong GCLAB_SHIFT = 21;
rkennke@53962 69 static const jlong SHARED_SHIFT = 28;
rkennke@53962 70
rkennke@53962 71 static const jlong STATUS_SHIFT = 58;
rkennke@53962 72
rkennke@53962 73 char* _name_space;
rkennke@53962 74 PerfLongVariable** _regions_data;
rkennke@53962 75 PerfLongVariable* _timestamp;
rkennke@53962 76 PerfLongVariable* _status;
rkennke@53962 77 volatile jlong _last_sample_millis;
rkennke@53962 78
rkennke@53962 79 public:
rkennke@53962 80 ShenandoahHeapRegionCounters();
rkennke@53962 81 ~ShenandoahHeapRegionCounters();
rkennke@53962 82 void update();
rkennke@53962 83 };
rkennke@53962 84
coleenp@54304 85 #endif // SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGIONCOUNTERS_HPP