4554N/A/*
4554N/A * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
4554N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4554N/A *
4554N/A * This code is free software; you can redistribute it and/or modify it
4554N/A * under the terms of the GNU General Public License version 2 only, as
4554N/A * published by the Free Software Foundation.
4554N/A *
4554N/A * This code is distributed in the hope that it will be useful, but WITHOUT
4554N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4554N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4554N/A * version 2 for more details (a copy is included in the LICENSE file that
4554N/A * accompanied this code).
4554N/A *
4554N/A * You should have received a copy of the GNU General Public License version
4554N/A * 2 along with this work; if not, write to the Free Software Foundation,
4554N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4554N/A *
4554N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4554N/A * or visit www.oracle.com if you need additional information or have any
4554N/A * questions.
4554N/A *
4554N/A */
4554N/A
4554N/A
4554N/A#include "precompiled.hpp"
4554N/A#include "gc_implementation/shared/objectCountEventSender.hpp"
4554N/A#include "memory/heapInspection.hpp"
4554N/A#include "trace/tracing.hpp"
4554N/A#include "utilities/globalDefinitions.hpp"
4554N/A
4555N/Avoid ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, jlong timestamp) {
4554N/A assert(Tracing::is_event_enabled(EventObjectCountAfterGC::eventId),
4554N/A "Only call this method if the event is enabled");
4554N/A
4555N/A EventObjectCountAfterGC event(UNTIMED);
4554N/A event.set_gcId(gc_id);
4554N/A event.set_class(entry->klass());
4554N/A event.set_count(entry->count());
4554N/A event.set_totalSize(entry->words() * BytesPerWord);
4555N/A event.set_endtime(timestamp);
4554N/A event.commit();
4554N/A}
4554N/A
4554N/Abool ObjectCountEventSender::should_send_event() {
4554N/A#if INCLUDE_TRACE
4554N/A return Tracing::is_event_enabled(EventObjectCountAfterGC::eventId);
4554N/A#else
4554N/A return false;
4554N/A#endif
4554N/A}