#!/usr/sbin/dtrace -s #pragma D option quiet #pragma D option defaultargs #pragma D option destructive /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing * permissions and limitations under the License. * * When distributing Covered Code, include this CDDL * HEADER in each file and include the License file at * usr/src/OPENSOLARIS.LICENSE. If applicable, * add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] * * CDDL HEADER END * * Copyright © 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ /* * Usage: * compilation.d -p JAVA_PID */ string thread_type[int]; :::BEGIN { thread_type[-1] = "JLT"; thread_type[1] = "RTT"; thread_type[0] = "NHRT"; system("rm vm.paused.%d", $target); } jrts$target:::class-loaded { printf("%d : Thread %d of type %s loads class %s with class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-required { printf("%d : Thread %d of type %s requires initialization of class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-recursive { printf("%d : Thread %d of type %s discovers that it is already in the process of initializing class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-concurrent { printf("%d : Thread %d of type %s discovers that another thread concurrently completed the initialization of class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-erroneous { printf("%d : Thread %d of type %s discovers that the class %s from class loader %d has already been marked as being in the \"erroneous\" state and can not be initialized\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-super-failed { printf("%d : Thread %d of type %s encounters an error trying to initialize the superclass of class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-clinit { printf("%d : Thread %d of type %s commences execution of the method of class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-error { printf("%d : Thread %d of type %s receives an exeception while execution the method of class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::class-initialization-end { printf("%d : Thread %d of type %s successful completes the execution of the method and completes initialization of class %s from class loader %d\n", timestamp, curthread->t_tid,thread_type[arg4], copyinstr(arg0,arg1),arg2); } jrts$target:::method-compile-begin { printf("%d : Compilation begins in class %s for method %s with prototype %s for thread type %s\n", timestamp, copyinstr(arg0,arg1),copyinstr(arg2,arg3),copyinstr(arg4,arg5), thread_type[arg6]); } jrts$target:::method-compile-end { printf("%d : Compilation ends in class %s for method %s with prototype %s for thread type %s\n", timestamp, copyinstr(arg0,arg1),copyinstr(arg2,arg3),copyinstr(arg4,arg5), thread_type[arg6]); } jrts$target:::compiler-patching-klass { printf("%d : In thread %d of type %s, patching reference to [class %s] in [method %s with prototype %s of class %s at bci %d]\n", timestamp,curthread->t_tid, thread_type[args[9]], copyinstr((uintptr_t)args[7],args[8]), copyinstr((uintptr_t)args[2],args[3]), copyinstr((uintptr_t)args[4],args[5]), copyinstr((uintptr_t)args[0],args[1]), args[6]); } jrts$target:::compiler-patching-tablecall { printf("%d : In thread %d of type %s, patching table call to [method %s with prototype %s from class %s] in [method %s with prototype %s of class %s at bci %d]\n", timestamp,curthread->t_tid, thread_type[args[13]], copyinstr((uintptr_t)args[9],args[10]), copyinstr((uintptr_t)args[11],args[12]), copyinstr((uintptr_t)args[7],args[8]), copyinstr((uintptr_t)args[2],args[3]), copyinstr((uintptr_t)args[4],args[5]), copyinstr((uintptr_t)args[0],args[1]), args[6]); } jrts$target:::compiler-patching-directcall { printf("%d : In thread %d of type %s, patching direct call to [method %s with prototype %s from class %s] in [method %s with prototype %s of class %s at bci %d]\n", timestamp,curthread->t_tid, thread_type[args[13]], copyinstr((uintptr_t)args[9],args[10]), copyinstr((uintptr_t)args[11],args[12]), copyinstr((uintptr_t)args[7],args[8]), copyinstr((uintptr_t)args[2],args[3]), copyinstr((uintptr_t)args[4],args[5]), copyinstr((uintptr_t)args[0],args[1]), args[6]); }