src/share/vm/prims/jvmtiRedefineClassesTrace.hpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2008, 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 // RedefineClasses tracing support via the TraceRedefineClasses
  26 // option. A bit is assigned to each group of trace messages.
  27 // Groups of messages are individually selectable. We have to use
  28 // decimal values on the command line since the command option
  29 // parsing logic doesn't like non-decimal numerics. The HEX values
  30 // are used in the actual RC_TRACE() calls for sanity. To achieve
  31 // the old cumulative behavior, pick the level after the one in
  32 // which you are interested and subtract one, e.g., 33554431 will
  33 // print every tracing message.
  34 //
  35 //    0x00000000 |          0 - default; no tracing messages
  36 //    0x00000001 |          1 - name each target class before loading, after
  37 //                              loading and after redefinition is completed
  38 //    0x00000002 |          2 - print info if parsing, linking or
  39 //                              verification throws an exception
  40 //    0x00000004 |          4 - print timer info for the VM operation
  41 //    0x00000008 |          8 - print subclass counter updates
  42 //    0x00000010 |         16 - unused
  43 //    0x00000020 |         32 - unused
  44 //    0x00000040 |         64 - unused


 104 //
 105 // ((high << 1) - 1)
 106 //     Yields a mask that removes bits greater than the high bit value.
 107 //     This algorithm doesn't work with highest bit.
 108 // ~(low - 1)
 109 //     Yields a mask that removes bits lower than the low bit value.
 110 #define RC_TRACE_IN_RANGE(low, high) \
 111 (((TraceRedefineClasses & ((high << 1) - 1)) & ~(low - 1)) != 0)
 112 
 113 // Timer support macros. Only do timer operations if timer tracing
 114 // is enabled. The "while (0)" is so we can use semi-colon at end of
 115 // the macro.
 116 #define RC_TIMER_START(t) \
 117   if (RC_TRACE_ENABLED(0x00000004)) { \
 118     t.start(); \
 119   } while (0)
 120 #define RC_TIMER_STOP(t) \
 121   if (RC_TRACE_ENABLED(0x00000004)) { \
 122     t.stop(); \
 123   } while (0)


   1 /*
   2  * Copyright (c) 2003, 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_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
  26 #define SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
  27 
  28 // RedefineClasses tracing support via the TraceRedefineClasses
  29 // option. A bit is assigned to each group of trace messages.
  30 // Groups of messages are individually selectable. We have to use
  31 // decimal values on the command line since the command option
  32 // parsing logic doesn't like non-decimal numerics. The HEX values
  33 // are used in the actual RC_TRACE() calls for sanity. To achieve
  34 // the old cumulative behavior, pick the level after the one in
  35 // which you are interested and subtract one, e.g., 33554431 will
  36 // print every tracing message.
  37 //
  38 //    0x00000000 |          0 - default; no tracing messages
  39 //    0x00000001 |          1 - name each target class before loading, after
  40 //                              loading and after redefinition is completed
  41 //    0x00000002 |          2 - print info if parsing, linking or
  42 //                              verification throws an exception
  43 //    0x00000004 |          4 - print timer info for the VM operation
  44 //    0x00000008 |          8 - print subclass counter updates
  45 //    0x00000010 |         16 - unused
  46 //    0x00000020 |         32 - unused
  47 //    0x00000040 |         64 - unused


 107 //
 108 // ((high << 1) - 1)
 109 //     Yields a mask that removes bits greater than the high bit value.
 110 //     This algorithm doesn't work with highest bit.
 111 // ~(low - 1)
 112 //     Yields a mask that removes bits lower than the low bit value.
 113 #define RC_TRACE_IN_RANGE(low, high) \
 114 (((TraceRedefineClasses & ((high << 1) - 1)) & ~(low - 1)) != 0)
 115 
 116 // Timer support macros. Only do timer operations if timer tracing
 117 // is enabled. The "while (0)" is so we can use semi-colon at end of
 118 // the macro.
 119 #define RC_TIMER_START(t) \
 120   if (RC_TRACE_ENABLED(0x00000004)) { \
 121     t.start(); \
 122   } while (0)
 123 #define RC_TIMER_STOP(t) \
 124   if (RC_TRACE_ENABLED(0x00000004)) { \
 125     t.stop(); \
 126   } while (0)
 127 
 128 #endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP