#!/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 © 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ /* * Usage: * handlers.d -p JAVA_PID */ string handler_type[int]; string thread_type[int]; string reason_type[int]; :::BEGIN { handler_type[0] = "HeapHandler"; handler_type[1] = "NoHeapHandler"; thread_type[0] = "RTT"; thread_type[1] = "NHRT"; reason_type[1] = "MIT_IGNORE"; reason_type[2] = "MIT_EXCEPT"; reason_type[3] = "MIT_REPLACE"; reason_type[4] = "MIT_SAVE"; reason_type[5] = "OVERFLOW_IGNORE"; reason_type[6] = "OVERFLOW_EXCEPT"; reason_type[7] = "OVERFLOW_REPLACE"; reason_type[8] = "OVERFLOW_SAVE"; system("rm vm.paused.%d", $target); } jrts$target:::event-fire { printf("%d : Event %p fired by thread %d\n",timestamp,arg0,curthread->t_tid); } jrts$target:::handler-creation { printf("%d : Thread %d is creating handler %p of type %s from class %s\n", timestamp,curthread->t_tid,arg0,handler_type[arg3],copyinstr(arg1,arg2)); } jrts$target:::handler-destruction { printf("%d : Destruction of handler %p\n", timestamp,arg0); } jrts$target:::handler-release-accepted { printf("%d : Release of handler %p accepted for release time %d with effective release time %d\n", timestamp,arg0,(long long)(arg1<<32)|arg2, (long long)(arg3<<32)|arg4); } jrts$target:::handler-release-replace { printf("%d : Release of handler %p accepted (through replacement of a previous release) for release time %d with effective release time %d\n", timestamp,arg0, (long long)(arg1<<32)|arg2, (long long)(arg3<<32)|arg4); } jrts$target:::handler-release-rejected { printf("%d : Release of handler %p rejected for release time %d (reason : %s)\n", timestamp,arg0, (long long)(arg1<<32)|arg2,reason_type[arg3]); } jrts$target:::handler-release-ignored { printf("%d : Release of handler %p ignored for release time %d (reason : %s)\n", timestamp,arg0, (long long)(arg1<<32)|arg2,reason_type[arg3]); } jrts$target:::server-thread-binding { printf("%d : Thread %d is binding server thread %d to handler %d\n", timestamp,curthread->t_tid,arg0,arg1); } jrts$target:::server-thread-unbinding { printf("%d : Server thread %d is unbinding itself from handler %p\n", timestamp,curthread->t_tid,arg0); } jrts$target:::server-thread-creation { printf("%d : Thread %d is creating server thread %d of type %s\n", timestamp,curthread->t_tid,arg0,thread_type[arg1]); } jrts$target:::server-thread-destruction { printf("%d : Destruction of server thread %d of type %s\n", timestamp,curthread->t_tid,thread_type[arg0]); } jrts$target:::server-thread-wakeup { printf("%d : Thread %d is waking up server thread %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::handler-start { printf("%d : Server thread %d is starting execution of handler %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::handler-end { printf("%d : Server thread %d is ending execution of handler %d\n", timestamp,curthread->t_tid,arg0); } jrts$target:::handler-deadline-miss { printf("%d : Release of deadline miss handler %p because a handler missed its deadline\n", timestamp,arg0); }