Wed, 10 Sep 2014 13:01:13 -0700
8057824: methods to copy allocation context statistics
Reviewed-by: mikael, jmasa, tschatzl
1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Sep 10 13:01:13 2014 -0700 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Sep 10 13:01:13 2014 -0700 1.3 @@ -1249,6 +1249,11 @@ 1.4 // The same as above but assume that the caller holds the Heap_lock. 1.5 void collect_locked(GCCause::Cause cause); 1.6 1.7 + virtual void copy_allocation_context_stats(const jint* contexts, 1.8 + jlong* totals, 1.9 + jbyte* accuracy, 1.10 + jint len); 1.11 + 1.12 // True iff an evacuation has failed in the most-recent collection. 1.13 bool evacuation_failed() { return _evacuation_failed; } 1.14
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap_ext.cpp Wed Sep 10 13:01:13 2014 -0700 2.3 @@ -0,0 +1,32 @@ 2.4 +/* 2.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. 2.11 + * 2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.15 + * version 2 for more details (a copy is included in the LICENSE file that 2.16 + * accompanied this code). 2.17 + * 2.18 + * You should have received a copy of the GNU General Public License version 2.19 + * 2 along with this work; if not, write to the Free Software Foundation, 2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.21 + * 2.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.23 + * or visit www.oracle.com if you need additional information or have any 2.24 + * questions. 2.25 + * 2.26 + */ 2.27 + 2.28 +#include "precompiled.hpp" 2.29 +#include "gc_implementation/g1/g1CollectedHeap.hpp" 2.30 + 2.31 +void G1CollectedHeap::copy_allocation_context_stats(const jint* contexts, 2.32 + jlong* totals, 2.33 + jbyte* accuracy, 2.34 + jint len) { 2.35 +}
3.1 --- a/src/share/vm/gc_interface/collectedHeap.hpp Wed Sep 10 13:01:13 2014 -0700 3.2 +++ b/src/share/vm/gc_interface/collectedHeap.hpp Wed Sep 10 13:01:13 2014 -0700 3.3 @@ -637,6 +637,15 @@ 3.4 // actual number may be germane. 3.5 static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; } 3.6 3.7 + // Copy the current allocation context statistics for the specified contexts. 3.8 + // For each context in contexts, set the corresponding entries in the totals 3.9 + // and accuracy arrays to the current values held by the statistics. Each 3.10 + // array should be of length len. 3.11 + virtual void copy_allocation_context_stats(const jint* contexts, 3.12 + jlong* totals, 3.13 + jbyte* accuracy, 3.14 + jint len) { } 3.15 + 3.16 /////////////// Unit tests /////////////// 3.17 3.18 NOT_PRODUCT(static void test_is_in();)