Path: blob/master/runtime/gc_verbose_old/VerboseManagerOld.hpp
5985 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#if !defined(VERBOSEMANAGEROLD_HPP_)24#define VERBOSEMANAGEROLD_HPP_2526#include "VerboseManagerBase.hpp"27#include "VerboseOutputAgent.hpp"282930/**31* Contains the old verbose codepath (-Xgc:verboseFormat:deprecated).32* @ingroup GC_verbose_engine33*/34class MM_VerboseManagerOld : public MM_VerboseManagerBase35{36/*37* Data members38*/39private:40J9JavaVM *javaVM;4142/* Pointers to the Hook interface */43J9HookInterface** _mmHooks;4445/* The event stream */46MM_VerboseEventStream *_eventStream;4748/* The Output agents */49MM_VerboseOutputAgent *_agentChain;5051protected:52public:5354/*55* Function members56*/57private:5859void chainOutputAgent(MM_VerboseOutputAgent *agent);60MM_VerboseOutputAgent *findAgentInChain(AgentType type);61void disableAgents();62UDATA countActiveOutputAgents();6364AgentType parseAgentType(MM_EnvironmentBase *env, char *filename, UDATA fileCount, UDATA iterations);6566/**67* Enable hooks for old verbose which are used in realtime configuration68*/69void enableVerboseGCRealtime();7071/**72* Disable hooks for old verbose which are used in realtime configuration73*/74void disableVerboseGCRealtime();7576/**77* Enable hooks for old verbose which are used in non-realtime configurations78*/79void enableVerboseGCNonRealtime();8081/**82* Disable hooks for old verbose which are used in non-realtime configurations83*/84void disableVerboseGCNonRealtime();8586/**87* Enable hooks for old verbose which are used in VLHGC configuration88*/89void enableVerboseGCVLHGC();9091/**92* Disable hooks for old verbose which are used in VLHGC configuration93*/94void disableVerboseGCVLHGC();9596protected:9798virtual bool initialize(MM_EnvironmentBase *env);99virtual void tearDown(MM_EnvironmentBase *env);100101public:102103MM_VerboseEventStream *getEventStreamForEvent(MM_VerboseEvent *event);104MM_VerboseEventStream *getEventStream() { return _eventStream; }105106/* Interface for Dynamic Configuration */107virtual bool configureVerboseGC(OMR_VM *omrVM, char* filename, UDATA fileCount, UDATA iterations);108109/**110* Determine the number of currently active output mechanisms.111* @return a count of the number of active output mechanisms.112*/113virtual UDATA countActiveOutputHandlers();114115/* Call for Event Stream */116void passStreamToOutputAgents(MM_EnvironmentBase *env, MM_VerboseEventStream *stream);117118virtual void enableVerboseGC();119virtual void disableVerboseGC();120121static MM_VerboseManagerOld *newInstance(MM_EnvironmentBase *env, OMR_VM* vm);122virtual void kill(MM_EnvironmentBase *env);123124/**125* Close all output mechanisms on the receiver.126* @param env vm thread.127*/128virtual void closeStreams(MM_EnvironmentBase *env);129130J9HookInterface** getHookInterface(){ return _mmHooks; }131132MM_VerboseManagerOld(OMR_VM *vm)133: MM_VerboseManagerBase(vm)134, _mmHooks(NULL)135, _eventStream(NULL)136, _agentChain(NULL)137{138}139};140141#endif /* VERBOSEMANAGEROLD_HPP_ */142143144