Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.debug/src/com/oracle/jvmci/debug/DebugMetric.java @ 21709:3c17c0c41a6b
moved com.oracle.asm.**.test to JVMCI namespace (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 03 Jun 2015 18:33:23 +0200 |
parents | b1530a6cce8c |
children |
rev | line source |
---|---|
4357
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
21554
b1530a6cce8c
renamed com.oracle.graal.[debug|options|hotspotvmconfig]* modules to com.oracle.jvmci.[debug|options|hotspotvmconfig]* modules (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21003
diff
changeset
|
23 package com.oracle.jvmci.debug; |
4357
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
11562
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
25 /** |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
26 * A counter for some value of interest. |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
27 */ |
4357
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
28 public interface DebugMetric { |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
5061
diff
changeset
|
29 |
11562
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
30 /** |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
31 * Adds 1 to this counter if metering is {@link Debug#isMeterEnabled() enabled} or this is an |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
32 * {@linkplain #isConditional() unconditional} metric. |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
33 */ |
4357
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
34 void increment(); |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
5061
diff
changeset
|
35 |
11562
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
36 /** |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
37 * Adds {@code value} to this counter if metering is {@link Debug#isMeterEnabled() enabled} or |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
38 * this is an {@linkplain #isConditional() unconditional} metric. |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
39 */ |
7557
db90c8b5a861
changed DebugMetric.add() to take a long parameter instead of an int
Doug Simon <doug.simon@oracle.com>
parents:
7530
diff
changeset
|
40 void add(long value); |
11562
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
41 |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
42 /** |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
43 * Sets a flag determining if this counter is only enabled if metering is |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
44 * {@link Debug#isMeterEnabled() enabled}. |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
45 */ |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
46 void setConditional(boolean flag); |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
47 |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
48 /** |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
49 * Determines if this counter is only enabled if metering is {@link Debug#isMeterEnabled() |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
50 * enabled}. |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
51 */ |
6b6c6e5d0fc2
added support for DebugMetric and DebugTimer objects to be unconditionally enabled (GRAAL-195)
Doug Simon <doug.simon@oracle.com>
parents:
7557
diff
changeset
|
52 boolean isConditional(); |
12778
c125485642e2
added getCurrentValue() to both DebugTimer and DebugValue; added getTimeUnit() to DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
11562
diff
changeset
|
53 |
c125485642e2
added getCurrentValue() to both DebugTimer and DebugValue; added getTimeUnit() to DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
11562
diff
changeset
|
54 /** |
c125485642e2
added getCurrentValue() to both DebugTimer and DebugValue; added getTimeUnit() to DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
11562
diff
changeset
|
55 * Gets the current value of this metric. |
c125485642e2
added getCurrentValue() to both DebugTimer and DebugValue; added getTimeUnit() to DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
11562
diff
changeset
|
56 */ |
c125485642e2
added getCurrentValue() to both DebugTimer and DebugValue; added getTimeUnit() to DebugTimer
Doug Simon <doug.simon@oracle.com>
parents:
11562
diff
changeset
|
57 long getCurrentValue(); |
21003
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
58 |
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
59 /** |
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
60 * Determines if this counter is enabled (either conditionally or unconditionally). |
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
61 */ |
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
62 default boolean isEnabled() { |
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
63 return !isConditional() || Debug.isMeterEnabled(); |
a7f216accfb5
Add DebugMetric.isEnabled().
Josef Eisl <josef.eisl@jku.at>
parents:
12778
diff
changeset
|
64 } |
4357
719ac1d92a52
More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
65 } |