#!/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: * threads.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:::thread-period-change { printf("%d : Thread %d is changing thread %d's period to %d\n", timestamp,curthread->t_tid,arg0,(long long)(arg1<<32)|arg2); } jrts$target:::thread-deschedule-periodic { printf("%d : Thread %d is calling deschedulePeriodic() on thread %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::thread-schedule-periodic { printf("%d : Thread %d is calling schedulePeriodic() on thread %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::thread-aie-fired { printf("%d : Thread %d is firing an Asynchronous Interruption Exception to thread %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::thread-aie-delivered { printf("%d : AIE delivered to thread %d\n",timestamp,curthread->t_tid); } jrts$target:::thread-aie-cleared { printf("%d : Thread %d is clearing an AIE\n",timestamp,curthread->t_tid); } jrts$target:::thread-start { printf("%d : Thread %d is starting thread %d called %s of type %s from class %s\n", timestamp,curthread->t_tid,arg0,copyinstr(arg4,arg5),thread_type[arg1], copyinstr(arg2,arg3)); } jrts$target:::thread-begin { printf("%d : Thread %d is starting its execution\n",timestamp,curthread->t_tid); } jrts$target:::thread-end { printf("%d : Thread %d is ending its execution\n",timestamp,curthread->t_tid); } jrts$target:::thread-wfnp-enter { printf("%d : Thread %d is entering waitForNextPeriod (interruptible == %d)\n", timestamp,curthread->t_tid,arg0); } jrts$target:::thread-wfnp-exit { printf("%d : Thread %d is exiting from waitForNextPeriod with return value = %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::thread-set-name { printf("%d : Thread %d is setting thread %d's name to %s\n",timestamp, curthread->t_tid,arg0,copyinstr(arg1,arg2)); } jrts$target:::thread-deadline-miss { printf("%d : Release of deadline miss handler %p because a thread missed its deadline\n", timestamp,arg0); }