Path: blob/master/runtime/gc_verbose_handler_vlhgc/VerboseHandlerOutputVLHGC.hpp
5986 views
/*******************************************************************************1* Copyright (c) 1991, 2021 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* 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-exception20*******************************************************************************/2122#if !defined(VERBOSEHANDLEROUTPUTVLHGC_HPP_)23#define VERBOSEHANDLEROUTPUTVLHGC_HPP_2425#include "j9.h"26#include "j9cfg.h"2728#include "VerboseHandlerOutput.hpp"2930#include "GCExtensions.hpp"3132class MM_EnvironmentBase;33class MM_InterRegionRememberedSetStats;34class MM_MarkVLHGCStats;35class MM_ReferenceStats;36class MM_WorkPacketStats;3738class MM_VerboseHandlerOutputVLHGC : public MM_VerboseHandlerOutput39{40private:4142protected:43J9HookInterface** _mmHooks; /**< Pointers to the Hook interface */4445public:4647private:48/**49* Output unfinalized processing summary.50* @param env GC thread used for output.51* @param indent base level of indentation for the summary.52* @param unfinalizedCandidates number of unfinalized candidates encountered.53* @param unfinalizedCount number of candidates that transitioned from unfinalized.54*/55void outputUnfinalizedInfo(MM_EnvironmentBase *env, UDATA indent, UDATA unfinalizedCandidates, UDATA unfinalizedCount);5657/**58* Output unfinalized processing summary.59* @param env GC thread used for output.60* @param indent base level of indentation for the summary.61* @param ownableSynchronizerCandidates number of ownable synchronizer candidates encountered.62* @param ownableSynchronizerCleared number of ownable synchronizer candidates cleared.63*/64void outputOwnableSynchronizerInfo(MM_EnvironmentBase *env, UDATA indent, UDATA ownableSynchronizerCandidates, UDATA ownableSynchronizerCleared);6566/**67* Output reference processing summary.68* @param env GC thread used for output.69* @param indent base level of indentation for the summary.70* @param referenceType character string representation of the reference type.71* @param referenceStats summary stats data of the processing.72* @param dynamicThreshold dynamic threshold value for reference73* @param maxThreshold maximum threshold value for reference. If it equal 0 thresholds should not be included to output line74*/75void outputReferenceInfo(MM_EnvironmentBase *env, UDATA indent, const char *referenceType, MM_ReferenceStats *referenceStats, UDATA dynamicThreshold, UDATA maxThreshold);7677/**78* Output a mark gc operation summary stanza.79* @param env GC thread performing output.80* @param markType String name representation of the mark type.81* @param markStats mark stats used for summary.82* @param workPacketStats work packet stats used for summary.83*/84void outputMarkSummary(MM_EnvironmentBase *env, const char *markType, MM_MarkVLHGCStats *markStats, MM_WorkPacketStats *workPacketStats, MM_InterRegionRememberedSetStats *irrsStats);8586/**87* Output info on remembered set clearing (from-CS-region clearing pass)88* @param env GC thread performing output.89* @param irrsStats Intra region remembered set stats.90*/91void outputRememberedSetClearedInfo(MM_EnvironmentBase *env, MM_InterRegionRememberedSetStats *irrsStats);929394protected:95virtual void outputInitializedInnerStanza(MM_EnvironmentBase *env, MM_VerboseBuffer *buffer);9697/**98* @returns true if memory-info staza is multiline. Caller than format first and last line accordingly.99*/100virtual bool hasOutputMemoryInfoInnerStanza();101/**102* The actual body (excluding first and last line) of memory-info stanza.103*/104virtual void outputMemoryInfoInnerStanza(MM_EnvironmentBase *env, UDATA indent, MM_CollectionStatistics *stats);105106virtual const char *getSubSpaceType(uintptr_t typeFlags);107108/* Print out allocations statistics109* @param current Env110*/111virtual void printAllocationStats(MM_EnvironmentBase* env);112113/**114* Answer a string representation of a given cycle type.115* @param[IN] cycle type116* @return string representing the human readable "type" of the cycle.117*/118virtual const char *getCycleType(UDATA type);119120virtual bool initialize(MM_EnvironmentBase *env, MM_VerboseManager *manager);121virtual void tearDown(MM_EnvironmentBase *env);122123virtual bool getThreadName(char *buf, UDATA bufLen, OMR_VMThread *vmThread);124virtual void writeVmArgs(MM_EnvironmentBase* env, MM_VerboseBuffer* buffer);125126MM_VerboseHandlerOutputVLHGC(MM_GCExtensions *extensions)127: MM_VerboseHandlerOutput(extensions)128, _mmHooks(NULL)129{};130131public:132static MM_VerboseHandlerOutput *newInstance(MM_EnvironmentBase *env, MM_VerboseManager *manager);133134/**135* Write the verbose stanza allocation taxation trigger point (preceding PGCs and GMP increments).136* @param hook Hook interface used by the JVM.137* @param eventNum The hook event number.138* @param eventData hook specific event data.139*/140void handleTaxationEntryPoint(J9HookInterface** hook, UDATA eventNum, void* eventData);141142/**143* Write the verbose stanza for the copy forward start event.144* @param hook Hook interface used by the JVM.145* @param eventNum The hook event number.146* @param eventData hook specific event data.147*/148void handleCopyForwardStart(J9HookInterface** hook, UDATA eventNum, void* eventData);149150/**151* Write the verbose stanza for the copy forward end event.152* @param hook Hook interface used by the JVM.153* @param eventNum The hook event number.154* @param eventData hook specific event data.155*/156void handleCopyForwardEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);157158virtual void handleConcurrentStartInternal(J9HookInterface** hook, UDATA eventNum, void* eventData);159virtual void handleConcurrentEndInternal(J9HookInterface** hook, UDATA eventNum, void* eventData);160virtual const char *getConcurrentTypeString(uintptr_t type) { return "GMP work packet processing"; }161162/**163* Write the verbose stanza for the GMP mark start event.164* @param hook Hook interface used by the JVM.165* @param eventNum The hook event number.166* @param eventData hook specific event data.167*/168void handleGMPMarkStart(J9HookInterface** hook, UDATA eventNum, void* eventData);169170/**171* Write the verbose stanza for the GMP mark end event.172* @param hook Hook interface used by the JVM.173* @param eventNum The hook event number.174* @param eventData hook specific event data.175*/176void handleGMPMarkEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);177178/**179* Write the verbose stanza for the global gc mark start event.180* @param hook Hook interface used by the JVM.181* @param eventNum The hook event number.182* @param eventData hook specific event data.183*/184void handleGlobalGCMarkStart(J9HookInterface** hook, UDATA eventNum, void* eventData);185186/**187* Write the verbose stanza for the global gc mark end event.188* @param hook Hook interface used by the JVM.189* @param eventNum The hook event number.190* @param eventData hook specific event data.191*/192void handleGlobalGCMarkEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);193194/**195* Write the verbose stanza for the PGC mark start event.196* @param hook Hook interface used by the JVM.197* @param eventNum The hook event number.198* @param eventData hook specific event data.199*/200void handlePGCMarkStart(J9HookInterface** hook, UDATA eventNum, void* eventData);201202/**203* Write the verbose stanza for the PGC mark end event.204* @param hook Hook interface used by the JVM.205* @param eventNum The hook event number.206* @param eventData hook specific event data.207*/208void handlePGCMarkEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);209210/**211* Write the verbose stanza for the reclaim sweep start event.212* @param hook Hook interface used by the JVM.213* @param eventNum The hook event number.214* @param eventData hook specific event data.215*/216void handleReclaimSweepStart(J9HookInterface** hook, UDATA eventNum, void* eventData);217218/**219* Write the verbose stanza for the reclaim sweep end event.220* @param hook Hook interface used by the JVM.221* @param eventNum The hook event number.222* @param eventData hook specific event data.223*/224void handleReclaimSweepEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);225226/**227* Write the verbose stanza for the reclaim compact start event.228* @param hook Hook interface used by the JVM.229* @param eventNum The hook event number.230* @param eventData hook specific event data.231*/232void handleReclaimCompactStart(J9HookInterface** hook, UDATA eventNum, void* eventData);233234/**235* Write the verbose stanza for the reclaim compact end event.236* @param hook Hook interface used by the JVM.237* @param eventNum The hook event number.238* @param eventData hook specific event data.239*/240void handleReclaimCompactEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);241242/**243* Write verbose stanza for a class unload end event.244* @param hook Hook interface used by the JVM.245* @param eventNum The hook event number.246* @param eventData hook specific event data.247*/248void handleClassUnloadEnd(J9HookInterface** hook, UDATA eventNum, void* eventData);249250virtual void enableVerbose();251virtual void disableVerbose();252253/**254* Return termination reason for concurrent collection.255* @param stats concurrent stats256* @return string representing the reason for termination257*/258const char *getConcurrentTerminationReason(MM_ConcurrentPhaseStatsBase *stats);259};260261#endif /* VERBOSEHANDLEROUTPUTVLHGC_HPP_ */262263264