1 /* 2 * Copyright (c) 2003, 2005, 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 # include "incls/_precompiled.incl" 26 # include "incls/_classLoadingService.cpp.incl" 27 28 #ifdef DTRACE_ENABLED 29 30 // Only bother with this argument setup if dtrace is available 31 32 HS_DTRACE_PROBE_DECL4(hotspot, class__loaded, char*, int, oop, bool); 33 HS_DTRACE_PROBE_DECL4(hotspot, class__unloaded, char*, int, oop, bool); 34 35 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared) \ 36 { \ 37 char* data = NULL; \ 38 int len = 0; \ 39 symbolOop name = (clss)->name(); \ 40 if (name != NULL) { \ 41 data = (char*)name->bytes(); \ 42 len = name->utf8_length(); \ 43 } \ 44 HS_DTRACE_PROBE4(hotspot, class__##type, \ 45 data, len, (clss)->class_loader(), (shared)); \ 46 } | 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 #include "precompiled.hpp" 26 #include "classfile/systemDictionary.hpp" 27 #include "memory/allocation.hpp" 28 #include "memory/universe.hpp" 29 #include "oops/oop.inline.hpp" 30 #include "runtime/mutexLocker.hpp" 31 #include "services/classLoadingService.hpp" 32 #include "services/memoryService.hpp" 33 #include "utilities/dtrace.hpp" 34 35 #ifdef DTRACE_ENABLED 36 37 // Only bother with this argument setup if dtrace is available 38 39 HS_DTRACE_PROBE_DECL4(hotspot, class__loaded, char*, int, oop, bool); 40 HS_DTRACE_PROBE_DECL4(hotspot, class__unloaded, char*, int, oop, bool); 41 42 #define DTRACE_CLASSLOAD_PROBE(type, clss, shared) \ 43 { \ 44 char* data = NULL; \ 45 int len = 0; \ 46 symbolOop name = (clss)->name(); \ 47 if (name != NULL) { \ 48 data = (char*)name->bytes(); \ 49 len = name->utf8_length(); \ 50 } \ 51 HS_DTRACE_PROBE4(hotspot, class__##type, \ 52 data, len, (clss)->class_loader(), (shared)); \ 53 } |