Path: blob/master/runtime/gc_stats/VLHGCCycleStats.hpp
5986 views
1/*******************************************************************************2* Copyright (c) 1991, 2014 IBM Corp. and others3*4* This program and the accompanying materials are made available under5* the terms of the Eclipse Public License 2.0 which accompanies this6* distribution and is available at https://www.eclipse.org/legal/epl-2.0/7* or the Apache License, Version 2.0 which accompanies this distribution and8* is available at https://www.apache.org/licenses/LICENSE-2.0.9*10* This Source Code may also be made available under the following11* Secondary Licenses when the conditions for such availability set12* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU13* General Public License, version 2 with the GNU Classpath14* Exception [1] and GNU General Public License, version 2 with the15* OpenJDK Assembly Exception [2].16*17* [1] https://www.gnu.org/software/classpath/license.html18* [2] http://openjdk.java.net/legal/assembly-exception.html19*20* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception21*******************************************************************************/2223/**24* @file25* @ingroup GC_Stats26*/2728#if !defined(VLHGCCYCLESTATS_HPP_)29#define VLHGCCYCLESTATS_HPP_3031#include "j9.h"32#include "j9cfg.h"33#include "j9port.h"34#include "j9consts.h"35#include "modronopt.h"3637#if defined(J9VM_GC_VLHGC)3839#include "Base.hpp"40#include "InterRegionRememberedSetStats.hpp"41#include "ModronAssertions.h"42#include "SweepVLHGCStats.hpp"43#include "WorkPacketStats.hpp"44#include "VLHGCIncrementStats.hpp"4546/**47* Storage for statistics relevant to the collection cycles48* @ingroup GC_Stats49*/50class MM_VLHGCCycleStats : public MM_Base51{52public:53class MM_MarkVLHGCStats _markStats; /**< Stats for mark phase of cycle */54class MM_MarkVLHGCStats _concurrentMarkStats; /**< Stats for concurrent mark phase of cycle */55class MM_MarkVLHGCStats _incrementalMarkStats; /**< Stats for incremental (stop-the-world) mark phase of cycle */56class MM_WorkPacketStats _workPacketStats; /**< Stats for work packet activity of cycle */57class MM_InterRegionRememberedSetStats _irrsStats; /**< Stats for Inter Region Remembered Set processing */5859public:60MM_VLHGCCycleStats() :61_markStats()62,_concurrentMarkStats()63,_incrementalMarkStats()64,_workPacketStats()65,_irrsStats()66{};6768/**69* Reset the statistics of the receiver for a new round.70*/71MMINLINE void clear()72{73_markStats.clear();74_concurrentMarkStats.clear();75_incrementalMarkStats.clear();76_workPacketStats.clear();77_irrsStats.clear();78}7980/**81* Add / combine the statistics from the parameter to the receiver.82*/83MMINLINE void merge(MM_VLHGCIncrementStats *stats)84{85_markStats.merge(&stats->_markStats);86_workPacketStats.merge(&stats->_workPacketStats);87_irrsStats.merge(&stats->_irrsStats);8889switch (stats->_globalMarkIncrementType) {90case MM_VLHGCIncrementStats::mark_concurrent:91_concurrentMarkStats.merge(&stats->_markStats);92break;9394case MM_VLHGCIncrementStats::mark_incremental:95_incrementalMarkStats.merge(&stats->_markStats);96break;9798case MM_VLHGCIncrementStats::mark_idle:99case MM_VLHGCIncrementStats::mark_global_collection:100break;101102default:103Assert_MM_unreachable();104}105}106107};108109#endif /* J9VM_GC_VLHGC */110#endif /* VLHGCCYCLESTATS_HPP_ */111112113