author | jwilhelm |
Mon, 04 May 2015 17:10:50 +0200 | |
changeset 30579 | 5208524ce05c |
parent 30574 | c38efb747c8a |
permissions | -rw-r--r-- |
12378
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
1 |
/* |
30574
c38efb747c8a
8073476: G1 logging ignores changes to PrintGC* flags via MXBeans
dfazunen
parents:
29680
diff
changeset
|
2 |
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
12378
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
4 |
* |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
8 |
* |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
13 |
* accompanied this code). |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
14 |
* |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
18 |
* |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
21 |
* questions. |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
22 |
* |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
23 |
*/ |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
24 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
25 |
#ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1LOG_HPP |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
26 |
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1LOG_HPP |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
27 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
28 |
#include "memory/allocation.hpp" |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
29 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
30 |
class G1Log : public AllStatic { |
29680
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
12378
diff
changeset
|
31 |
public: |
12378
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
32 |
typedef enum { |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
33 |
LevelNone, |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
34 |
LevelFine, |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
35 |
LevelFiner, |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
36 |
LevelFinest |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
37 |
} LogLevel; |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
38 |
|
29680
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
12378
diff
changeset
|
39 |
private: |
12378
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
40 |
static LogLevel _level; |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
41 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
42 |
public: |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
43 |
inline static bool fine() { |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
44 |
return _level >= LevelFine; |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
45 |
} |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
46 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
47 |
inline static bool finer() { |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
48 |
return _level >= LevelFiner; |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
49 |
} |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
50 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
51 |
inline static bool finest() { |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
52 |
return _level == LevelFinest; |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
53 |
} |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
54 |
|
29680
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
12378
diff
changeset
|
55 |
static LogLevel level() { |
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
12378
diff
changeset
|
56 |
return _level; |
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
12378
diff
changeset
|
57 |
} |
e5203ed6d805
8074037: Refactor the G1GCPhaseTime logging to make it easier to add new phases
brutisso
parents:
12378
diff
changeset
|
58 |
|
12378
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
59 |
static void init(); |
30574
c38efb747c8a
8073476: G1 logging ignores changes to PrintGC* flags via MXBeans
dfazunen
parents:
29680
diff
changeset
|
60 |
|
c38efb747c8a
8073476: G1 logging ignores changes to PrintGC* flags via MXBeans
dfazunen
parents:
29680
diff
changeset
|
61 |
// Update to log level to reflect runtime changes to manageable flags |
c38efb747c8a
8073476: G1 logging ignores changes to PrintGC* flags via MXBeans
dfazunen
parents:
29680
diff
changeset
|
62 |
static void update_level(); |
12378
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
63 |
}; |
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
64 |
|
ed44b9ecfa2f
7160728: Introduce an extra logging level for G1 logging
brutisso
parents:
diff
changeset
|
65 |
#endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1LOG_HPP |