Path: blob/master/runtime/gc_verbose_old/VerboseEventStream.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(EVENTSTREAM_HPP_)24#define EVENTSTREAM_HPP_2526#include "j9.h"27#include "j9cfg.h"28#include "modron.h"2930#include "Base.hpp"31#include "EnvironmentBase.hpp"3233class MM_VerboseEvent;34class MM_VerboseManager;35class MM_VerboseManagerOld;3637/**38* Part of the verbose gc mechanism.39* Provides management routines and the anchor point for the chain of MM_VerboseEvents.40* @ingroup GC_verbose_engine41*/42class MM_VerboseEventStream : public MM_Base43{44private:45J9JavaVM *_javaVM;46MM_VerboseManagerOld* _manager;4748/* Anchor point for chained events */49MM_VerboseEvent *_eventChain;50/* Last entry in Event chain */51MM_VerboseEvent * volatile _eventChainTail;5253bool _disposable; /**< Determines if the event stream should be disposed of immediately after processing. */5455void callConsumeRoutines(MM_EnvironmentBase *env);56void removeNonOutputEvents(MM_EnvironmentBase *env);5758void removeEventFromChain(MM_EnvironmentBase *env, MM_VerboseEvent *event);5960void tearDown(MM_EnvironmentBase *env);6162public:63static MM_VerboseEventStream *newInstance(MM_EnvironmentBase *env, MM_VerboseManagerOld *manager);64virtual void kill(MM_EnvironmentBase *env);6566MMINLINE MM_VerboseEvent *getHead() { return _eventChain; }67MMINLINE MM_VerboseEvent *getTail() { return (MM_VerboseEvent *)_eventChainTail; }6869void chainEvent(MM_EnvironmentBase *env, MM_VerboseEvent *event);70void processStream(MM_EnvironmentBase *env);7172MM_VerboseEvent *returnEvent(UDATA eventid, J9HookInterface** hook, MM_VerboseEvent *event);73MM_VerboseEvent *returnEvent(UDATA eventid, J9HookInterface** hook, MM_VerboseEvent *event, UDATA stopEventID, J9HookInterface** stopHookInterface);7475void setDisposable(bool disposable) { _disposable = disposable; }76bool isDisposable() { return _disposable; }7778MM_VerboseEventStream(MM_EnvironmentBase *env, MM_VerboseManagerOld *manager) :79MM_Base(),80_javaVM((J9JavaVM *)env->getLanguageVM()),81_manager(manager),82_eventChain(NULL),83_eventChainTail(NULL),84_disposable(false)85{}86};8788#endif /* EVENTSTREAM_HPP_ */899091