8009538: [Event Request] Want events for tenuring distribution

Reviewed-by: jwilhelm, sjohanss
This commit is contained in:
David Lindholm 2016-02-12 09:12:12 +01:00
parent 1246d21895
commit 7323d69771
4 changed files with 93 additions and 5 deletions

View file

@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "gc/shared/ageTable.inline.hpp"
#include "gc/shared/ageTableTracer.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "gc/shared/collectorPolicy.hpp"
#include "gc/shared/gcPolicyCounters.hpp"
@ -100,17 +101,19 @@ uint AgeTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCoun
log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold " UINTX_FORMAT " (max threshold " UINTX_FORMAT ")",
desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold);
if (log_is_enabled(Trace, gc, age) || UsePerfData) {
if (log_is_enabled(Trace, gc, age) || UsePerfData || AgeTableTracer::is_tenuring_distribution_event_enabled()) {
size_t total = 0;
uint age = 1;
while (age < table_size) {
total += sizes[age];
if (sizes[age] > 0) {
size_t wordSize = sizes[age];
total += wordSize;
if (wordSize > 0) {
log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total",
age, sizes[age]*oopSize, total*oopSize);
age, wordSize*oopSize, total*oopSize);
}
AgeTableTracer::send_tenuring_distribution_event(age, wordSize*oopSize);
if (UsePerfData) {
_perf_sizes[age]->set_value(sizes[age]*oopSize);
_perf_sizes[age]->set_value(wordSize*oopSize);
}
age++;
}

View file

@ -0,0 +1,42 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc/shared/ageTableTracer.hpp"
#include "gc/shared/gcId.hpp"
#include "trace/tracing.hpp"
void AgeTableTracer::send_tenuring_distribution_event(uint age, size_t size) {
EventTenuringDistribution e;
if (e.should_commit()) {
e.set_gcId(GCId::current());
e.set_age(age);
e.set_size(size);
e.commit();
}
}
bool AgeTableTracer::is_tenuring_distribution_event_enabled() {
return EventTenuringDistribution::is_enabled();
}

View file

@ -0,0 +1,36 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_GC_SHARED_AGETABLETRACER_HPP
#define SHARE_VM_GC_SHARED_AGETABLETRACER_HPP
#include "memory/allocation.hpp"
class AgeTableTracer : AllStatic {
public:
static void send_tenuring_distribution_event(uint age, size_t size);
static bool is_tenuring_distribution_event_enabled();
};
#endif // SHARE_VM_GC_SHARED_AGETABLETRACER_HPP

View file

@ -479,6 +479,13 @@ Declares a structure type that can be used in other events.
<value type="BYTES64" field="size" label="Allocation Size" />
</event>
<event id="TenuringDistribution" path="vm/gc/detailed/tenuring_distribution" label="Tenuring Distribution"
is_instant="true">
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
<value type="UINT" field="age" label="Age" />
<value type="BYTES64" field="size" label="Size" />
</event>
<!-- Compiler events -->
<event id="Compilation" path="vm/compiler/compilation" label="Compilation"