1 /*
2 * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /* jvmstat global and subsystem counter name space - enumeration value
26 * serve as an index into the PerfDataManager::_name_space[] array
27 * containing the corresponding name space string. Only the top level
28 * subsystem name spaces are represented here.
29 */
30 enum CounterNS {
31 // top level name spaces
32 JAVA_NS,
33 COM_NS,
34 SUN_NS,
35 // subsystem name spaces
36 JAVA_GC, // Garbage Collection name spaces
37 COM_GC,
38 SUN_GC,
39 JAVA_CI, // Compiler name spaces
40 COM_CI,
41 SUN_CI,
42 JAVA_CLS, // Class Loader name spaces
43 COM_CLS,
44 SUN_CLS,
940 * block. The UsePerfData guard is used with the implementation
941 * of this class.
942 *
943 */
944 class PerfTraceTimedEvent : public PerfTraceTime {
945
946 protected:
947 PerfLongCounter* _eventp;
948
949 public:
950 inline PerfTraceTimedEvent(PerfLongCounter* timerp, PerfLongCounter* eventp): PerfTraceTime(timerp), _eventp(eventp) {
951 if (!UsePerfData) return;
952 _eventp->inc();
953 }
954
955 inline PerfTraceTimedEvent(PerfLongCounter* timerp, PerfLongCounter* eventp, int* recursion_counter): PerfTraceTime(timerp, recursion_counter), _eventp(eventp) {
956 if (!UsePerfData) return;
957 _eventp->inc();
958 }
959 };
|
1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_PERFDATA_HPP
26 #define SHARE_VM_RUNTIME_PERFDATA_HPP
27
28 #include "memory/allocation.inline.hpp"
29 #include "runtime/perfMemory.hpp"
30 #include "runtime/timer.hpp"
31 #include "utilities/growableArray.hpp"
32
33 /* jvmstat global and subsystem counter name space - enumeration value
34 * serve as an index into the PerfDataManager::_name_space[] array
35 * containing the corresponding name space string. Only the top level
36 * subsystem name spaces are represented here.
37 */
38 enum CounterNS {
39 // top level name spaces
40 JAVA_NS,
41 COM_NS,
42 SUN_NS,
43 // subsystem name spaces
44 JAVA_GC, // Garbage Collection name spaces
45 COM_GC,
46 SUN_GC,
47 JAVA_CI, // Compiler name spaces
48 COM_CI,
49 SUN_CI,
50 JAVA_CLS, // Class Loader name spaces
51 COM_CLS,
52 SUN_CLS,
948 * block. The UsePerfData guard is used with the implementation
949 * of this class.
950 *
951 */
952 class PerfTraceTimedEvent : public PerfTraceTime {
953
954 protected:
955 PerfLongCounter* _eventp;
956
957 public:
958 inline PerfTraceTimedEvent(PerfLongCounter* timerp, PerfLongCounter* eventp): PerfTraceTime(timerp), _eventp(eventp) {
959 if (!UsePerfData) return;
960 _eventp->inc();
961 }
962
963 inline PerfTraceTimedEvent(PerfLongCounter* timerp, PerfLongCounter* eventp, int* recursion_counter): PerfTraceTime(timerp, recursion_counter), _eventp(eventp) {
964 if (!UsePerfData) return;
965 _eventp->inc();
966 }
967 };
968
969 #endif // SHARE_VM_RUNTIME_PERFDATA_HPP
|