Mon, 12 Aug 2019 18:30:40 +0300
8223147: JFR Backport
8199712: Flight Recorder
8203346: JFR: Inconsistent signature of jfr_add_string_constant
8195817: JFR.stop should require name of recording
8195818: JFR.start should increase autogenerated name by one
8195819: Remove recording=x from jcmd JFR.check output
8203921: JFR thread sampling is missing fixes from JDK-8194552
8203929: Limit amount of data for JFR.dump
8203664: JFR start failure after AppCDS archive created with JFR StartFlightRecording
8003209: JFR events for network utilization
8207392: [PPC64] Implement JFR profiling
8202835: jfr/event/os/TestSystemProcess.java fails on missing events
Summary: Backport JFR from JDK11. Initial integration
Reviewed-by: neugens
jiangli@4936 | 1 | /* |
jiangli@4936 | 2 | * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
jiangli@4936 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
jiangli@4936 | 4 | * |
jiangli@4936 | 5 | * This code is free software; you can redistribute it and/or modify it |
jiangli@4936 | 6 | * under the terms of the GNU General Public License version 2 only, as |
jiangli@4936 | 7 | * published by the Free Software Foundation. |
jiangli@4936 | 8 | * |
jiangli@4936 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
jiangli@4936 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
jiangli@4936 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
jiangli@4936 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
jiangli@4936 | 13 | * accompanied this code). |
jiangli@4936 | 14 | * |
jiangli@4936 | 15 | * You should have received a copy of the GNU General Public License version |
jiangli@4936 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
jiangli@4936 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
jiangli@4936 | 18 | * |
jiangli@4936 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
jiangli@4936 | 20 | * or visit www.oracle.com if you need additional information or have any |
jiangli@4936 | 21 | * questions. |
jiangli@4936 | 22 | * |
jiangli@4936 | 23 | */ |
jiangli@4936 | 24 | #include "precompiled.hpp" |
jiangli@4936 | 25 | #include "oops/methodCounters.hpp" |
jiangli@4936 | 26 | #include "runtime/thread.inline.hpp" |
jiangli@4936 | 27 | |
jiangli@4936 | 28 | MethodCounters* MethodCounters::allocate(ClassLoaderData* loader_data, TRAPS) { |
iklam@5208 | 29 | return new(loader_data, size(), false, MetaspaceObj::MethodCountersType, THREAD) MethodCounters(); |
jiangli@4936 | 30 | } |
jiangli@4936 | 31 | |
jiangli@4936 | 32 | void MethodCounters::clear_counters() { |
jiangli@4936 | 33 | invocation_counter()->reset(); |
jiangli@4936 | 34 | backedge_counter()->reset(); |
jiangli@4936 | 35 | set_interpreter_throwout_count(0); |
jiangli@4936 | 36 | set_interpreter_invocation_count(0); |
iveresov@7171 | 37 | #ifdef TIERED |
iveresov@7171 | 38 | set_prev_time(0); |
iveresov@7171 | 39 | set_rate(0); |
iveresov@7171 | 40 | set_highest_comp_level(0); |
iveresov@7171 | 41 | set_highest_osr_comp_level(0); |
iveresov@7171 | 42 | #endif |
jiangli@4936 | 43 | } |
iveresov@7171 | 44 | |
iveresov@7171 | 45 | |
iveresov@7171 | 46 | int MethodCounters::highest_comp_level() const { |
iveresov@7171 | 47 | #ifdef TIERED |
iveresov@7171 | 48 | return _highest_comp_level; |
iveresov@7171 | 49 | #else |
iveresov@7171 | 50 | return CompLevel_none; |
iveresov@7171 | 51 | #endif |
iveresov@7171 | 52 | } |
iveresov@7171 | 53 | |
iveresov@7171 | 54 | void MethodCounters::set_highest_comp_level(int level) { |
iveresov@7171 | 55 | #ifdef TIERED |
iveresov@7171 | 56 | _highest_comp_level = level; |
iveresov@7171 | 57 | #endif |
iveresov@7171 | 58 | } |
iveresov@7171 | 59 | |
iveresov@7171 | 60 | int MethodCounters::highest_osr_comp_level() const { |
iveresov@7171 | 61 | #ifdef TIERED |
iveresov@7171 | 62 | return _highest_osr_comp_level; |
iveresov@7171 | 63 | #else |
iveresov@7171 | 64 | return CompLevel_none; |
iveresov@7171 | 65 | #endif |
iveresov@7171 | 66 | } |
iveresov@7171 | 67 | |
iveresov@7171 | 68 | void MethodCounters::set_highest_osr_comp_level(int level) { |
iveresov@7171 | 69 | #ifdef TIERED |
iveresov@7171 | 70 | _highest_osr_comp_level = level; |
iveresov@7171 | 71 | #endif |
iveresov@7171 | 72 | } |
iveresov@7171 | 73 |