annotate src/hotspot/share/gc/shared/collectorCounters.cpp @ 48073:5caa1d5f74c1

8186571: Implementation: JEP 307: Parallel Full GC for G1 Summary: Improve G1 worst-case latencies by making the full GC parallel. Reviewed-by: tschatzl, sangheki, ehelin
author sjohanss
date Tue, 14 Nov 2017 11:33:23 +0100
parents fec48bf5a827
children d8ec0640616c
rev   line source
duke@1 1 /*
pliden@30764 2 * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
duke@1 7 * published by the Free Software Foundation.
duke@1 8 *
duke@1 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 13 * accompanied this code).
duke@1 14 *
duke@1 15 * You should have received a copy of the GNU General Public License version
duke@1 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 18 *
trims@5547 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@5547 20 * or visit www.oracle.com if you need additional information or have any
trims@5547 21 * questions.
duke@1 22 *
duke@1 23 */
duke@1 24
stefank@7397 25 #include "precompiled.hpp"
pliden@30764 26 #include "gc/shared/collectorCounters.hpp"
stefank@7397 27 #include "memory/resourceArea.hpp"
duke@1 28
duke@1 29 CollectorCounters::CollectorCounters(const char* name, int ordinal) {
duke@1 30
duke@1 31 if (UsePerfData) {
duke@1 32 EXCEPTION_MARK;
duke@1 33 ResourceMark rm;
duke@1 34
duke@1 35 const char* cns = PerfDataManager::name_space("collector", ordinal);
duke@1 36
zgu@13195 37 _name_space = NEW_C_HEAP_ARRAY(char, strlen(cns)+1, mtGC);
duke@1 38 strcpy(_name_space, cns);
duke@1 39
duke@1 40 char* cname = PerfDataManager::counter_name(_name_space, "name");
duke@1 41 PerfDataManager::create_string_constant(SUN_GC, cname, name, CHECK);
duke@1 42
duke@1 43 cname = PerfDataManager::counter_name(_name_space, "invocations");
duke@1 44 _invocations = PerfDataManager::create_counter(SUN_GC, cname,
duke@1 45 PerfData::U_Events, CHECK);
duke@1 46
duke@1 47 cname = PerfDataManager::counter_name(_name_space, "time");
duke@1 48 _time = PerfDataManager::create_counter(SUN_GC, cname, PerfData::U_Ticks,
duke@1 49 CHECK);
duke@1 50
duke@1 51 cname = PerfDataManager::counter_name(_name_space, "lastEntryTime");
duke@1 52 _last_entry_time = PerfDataManager::create_variable(SUN_GC, cname,
duke@1 53 PerfData::U_Ticks,
duke@1 54 CHECK);
duke@1 55
duke@1 56 cname = PerfDataManager::counter_name(_name_space, "lastExitTime");
duke@1 57 _last_exit_time = PerfDataManager::create_variable(SUN_GC, cname,
duke@1 58 PerfData::U_Ticks,
duke@1 59 CHECK);
duke@1 60 }
duke@1 61 }