src/share/vm/prims/jvmtiRedefineClassesTrace.hpp

Wed, 27 Aug 2014 08:19:12 -0400

author
zgu
date
Wed, 27 Aug 2014 08:19:12 -0400
changeset 7074
833b0f92429a
parent 4871
6b19fe41b577
child 6876
710a3c8b516e
permissions
-rw-r--r--

8046598: Scalable Native memory tracking development
Summary: Enhance scalability of native memory tracking
Reviewed-by: coleenp, ctornqvi, gtriantafill

duke@435 1 /*
dcubed@4562 2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
stefank@2314 26 #define SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
stefank@2314 27
duke@435 28 // RedefineClasses tracing support via the TraceRedefineClasses
duke@435 29 // option. A bit is assigned to each group of trace messages.
duke@435 30 // Groups of messages are individually selectable. We have to use
duke@435 31 // decimal values on the command line since the command option
duke@435 32 // parsing logic doesn't like non-decimal numerics. The HEX values
duke@435 33 // are used in the actual RC_TRACE() calls for sanity. To achieve
duke@435 34 // the old cumulative behavior, pick the level after the one in
duke@435 35 // which you are interested and subtract one, e.g., 33554431 will
duke@435 36 // print every tracing message.
duke@435 37 //
duke@435 38 // 0x00000000 | 0 - default; no tracing messages
duke@435 39 // 0x00000001 | 1 - name each target class before loading, after
duke@435 40 // loading and after redefinition is completed
duke@435 41 // 0x00000002 | 2 - print info if parsing, linking or
duke@435 42 // verification throws an exception
duke@435 43 // 0x00000004 | 4 - print timer info for the VM operation
duke@435 44 // 0x00000008 | 8 - print subclass counter updates
duke@435 45 // 0x00000010 | 16 - unused
duke@435 46 // 0x00000020 | 32 - unused
duke@435 47 // 0x00000040 | 64 - unused
duke@435 48 // 0x00000080 | 128 - unused
duke@435 49 // 0x00000100 | 256 - previous class weak reference addition
duke@435 50 // 0x00000200 | 512 - previous class weak reference mgmt during
duke@435 51 // class unloading checks (GC)
duke@435 52 // 0x00000400 | 1024 - previous class weak reference mgmt during
duke@435 53 // add previous ops (GC)
duke@435 54 // 0x00000800 | 2048 - previous class breakpoint mgmt
dcubed@1045 55 // 0x00001000 | 4096 - detect calls to obsolete methods
dcubed@1045 56 // 0x00002000 | 8192 - fail a guarantee() in addition to detection
dcubed@4562 57 // 0x00004000 | 16384 - detect old/obsolete methods in metadata
duke@435 58 // 0x00008000 | 32768 - old/new method matching/add/delete
duke@435 59 // 0x00010000 | 65536 - impl details: CP size info
duke@435 60 // 0x00020000 | 131072 - impl details: CP merge pass info
duke@435 61 // 0x00040000 | 262144 - impl details: CP index maps
duke@435 62 // 0x00080000 | 524288 - impl details: modified CP index values
duke@435 63 // 0x00100000 | 1048576 - impl details: vtable updates
duke@435 64 // 0x00200000 | 2097152 - impl details: itable updates
duke@435 65 // 0x00400000 | 4194304 - impl details: constant pool cache updates
duke@435 66 // 0x00800000 | 8388608 - impl details: methodComparator info
duke@435 67 // 0x01000000 | 16777216 - impl details: nmethod evolution info
duke@435 68 // 0x02000000 | 33554432 - impl details: annotation updates
duke@435 69 // 0x04000000 | 67108864 - impl details: StackMapTable updates
dcubed@483 70 // 0x08000000 | 134217728 - impl details: OopMapCache updates
duke@435 71 // 0x10000000 | 268435456 - unused
duke@435 72 // 0x20000000 | 536870912 - unused
duke@435 73 // 0x40000000 | 1073741824 - unused
duke@435 74 // 0x80000000 | 2147483648 - unused
duke@435 75
duke@435 76 // Macro for checking if TraceRedefineClasses has a specific bit
duke@435 77 // enabled. Returns true if the bit specified by level is set.
duke@435 78 #define RC_TRACE_ENABLED(level) ((TraceRedefineClasses & level) != 0)
duke@435 79
duke@435 80 // Macro for checking if TraceRedefineClasses has one or more bits
duke@435 81 // set in a range of bit values. Returns true if one or more bits
duke@435 82 // is set in the range from low..high inclusive. Assumes that low
duke@435 83 // and high are single bit values.
duke@435 84 //
duke@435 85 // ((high << 1) - 1)
duke@435 86 // Yields a mask that removes bits greater than the high bit value.
duke@435 87 // This algorithm doesn't work with highest bit.
duke@435 88 // ~(low - 1)
duke@435 89 // Yields a mask that removes bits lower than the low bit value.
duke@435 90 #define RC_TRACE_IN_RANGE(low, high) \
duke@435 91 (((TraceRedefineClasses & ((high << 1) - 1)) & ~(low - 1)) != 0)
duke@435 92
kmo@4871 93 // Note: The ResourceMark is to cleanup resource allocated args.
kmo@4871 94 // The "do {...} while (0)" is so we can use semi-colon at end of RC_TRACE().
kmo@4871 95 #define RC_TRACE(level, args) do { \
kmo@4871 96 if (RC_TRACE_ENABLED(level)) { \
kmo@4871 97 ResourceMark rm; \
kmo@4871 98 tty->print("RedefineClasses-0x%x: ", level); \
kmo@4871 99 tty->print_cr args; \
kmo@4871 100 } \
kmo@4871 101 } while (0)
kmo@4871 102
kmo@4871 103 #define RC_TRACE_NO_CR(level, args) do { \
kmo@4871 104 if (RC_TRACE_ENABLED(level)) { \
kmo@4871 105 ResourceMark rm; \
kmo@4871 106 tty->print("RedefineClasses-0x%x: ", level); \
kmo@4871 107 tty->print args; \
kmo@4871 108 } \
kmo@4871 109 } while (0)
kmo@4871 110
kmo@4871 111 #define RC_TRACE_WITH_THREAD(level, thread, args) do { \
kmo@4871 112 if (RC_TRACE_ENABLED(level)) { \
kmo@4871 113 ResourceMark rm(thread); \
kmo@4871 114 tty->print("RedefineClasses-0x%x: ", level); \
kmo@4871 115 tty->print_cr args; \
kmo@4871 116 } \
kmo@4871 117 } while (0)
kmo@4871 118
kmo@4871 119 #define RC_TRACE_MESG(args) do { \
kmo@4871 120 ResourceMark rm; \
kmo@4871 121 tty->print("RedefineClasses: "); \
kmo@4871 122 tty->print_cr args; \
kmo@4871 123 } while (0)
kmo@4871 124
kmo@4871 125 // Timer support macros. Only do timer operations if timer tracing is enabled.
kmo@4871 126 // The "do {...} while (0)" is so we can use semi-colon at end of the macro.
kmo@4871 127 #define RC_TIMER_START(t) do { \
duke@435 128 if (RC_TRACE_ENABLED(0x00000004)) { \
duke@435 129 t.start(); \
kmo@4871 130 } \
kmo@4871 131 } while (0)
kmo@4871 132 #define RC_TIMER_STOP(t) do { \
duke@435 133 if (RC_TRACE_ENABLED(0x00000004)) { \
duke@435 134 t.stop(); \
kmo@4871 135 } \
kmo@4871 136 } while (0)
stefank@2314 137
stefank@2314 138 #endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP

mercurial