Path: blob/master/runtime/gc_verbose_old_events/VerboseEventConcurrentlyCompletedSweepPhase.cpp
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#include "j9.h"24#include "j9cfg.h"2526#include "VerboseEventConcurrentlyCompletedSweepPhase.hpp"2728#include "GCExtensions.hpp"29#include "VerboseManagerOld.hpp"3031/**32* Create an new instance of a MM_VerboseEventGlobalGCEnd event.33* @param event Pointer to a structure containing the data passed over the hookInterface34*/35MM_VerboseEvent *36MM_VerboseEventConcurrentlyCompletedSweepPhase::newInstance(MM_ConcurrentlyCompletedSweepPhase *event, J9HookInterface** hookInterface)37{38MM_VerboseEventConcurrentlyCompletedSweepPhase *eventObject;3940eventObject = (MM_VerboseEventConcurrentlyCompletedSweepPhase *)MM_VerboseEvent::create(event->currentThread, sizeof(MM_VerboseEventConcurrentlyCompletedSweepPhase));41if(NULL != eventObject) {42new(eventObject) MM_VerboseEventConcurrentlyCompletedSweepPhase(event, hookInterface);43eventObject->initialize();44}45return eventObject;46}4748void49MM_VerboseEventConcurrentlyCompletedSweepPhase::initialize(void)50{51OMRPORT_ACCESS_FROM_OMRVMTHREAD(_omrThread);52_timeInMilliSeconds = omrtime_current_time_millis();53}5455/**56* Populate events data fields.57* The event calls the event stream requesting the address of events it is interested in.58* When an address is returned it populates itself with the data.59*/60void61MM_VerboseEventConcurrentlyCompletedSweepPhase::consumeEvents(void)62{63}6465/**66* Passes a format string and data to the output routine defined in the passed output agent.67* @param agent Pointer to an output agent.68*/69void70MM_VerboseEventConcurrentlyCompletedSweepPhase::formattedOutput(MM_VerboseOutputAgent *agent)71{72OMRPORT_ACCESS_FROM_OMRVMTHREAD(_omrThread);73char timestamp[32];74UDATA indentLevel = _manager->getIndentLevel();7576omrstr_ftime(timestamp, sizeof(timestamp), VERBOSEGC_DATE_FORMAT, _timeInMilliSeconds);77agent->formatAndOutput(static_cast<J9VMThread*>(_omrThread->_language_vmthread), indentLevel, "<con event=\"completed sweep\" timestamp=\"%s\">", timestamp);7879_manager->incrementIndent();80indentLevel = _manager->getIndentLevel();8182agent->formatAndOutput(static_cast<J9VMThread*>(_omrThread->_language_vmthread), indentLevel, "<stats bytes=\"%zu\" time=\"%llu.%03.3llu\" />",83_bytesSwept,84_timeElapsed / 1000,85_timeElapsed % 1000);8687_manager->decrementIndent();88indentLevel = _manager->getIndentLevel();8990agent->formatAndOutput(static_cast<J9VMThread*>(_omrThread->_language_vmthread), indentLevel, "</con>");91agent->endOfCycle(static_cast<J9VMThread*>(_omrThread->_language_vmthread));92}939495