#!/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: * rtgc.d -p JAVA_PID */ struct rtgc_alloc_stats { uint32_t normal_total; uint32_t normal_worst; uint32_t normal_average; uint32_t boosted_total; uint32_t boosted_worst; uint32_t boosted_average; uint32_t critical_in_critical; uint32_t critical_critical; uint32_t critical_worst; uint32_t critical_worst_approx; uint32_t critical_total; }; struct rtgc_alloc_stats *stats; :::BEGIN / $1 == "" / { system("rm vm.paused.%d", $target); } jrts$target:::rtgc-cycle-begin { printf("%d : RTGC cycle begins\n",timestamp); } jrts$target:::rtgc-cycle-end { printf("%d : RTGC cycle ends\n",timestamp); } jrts$target:::rtgc-change-priority { printf("%d : RTGC's priority changed to %d\n",timestamp,arg0); } jrts$target:::rtgc-worker-thread-start { printf("%d : RTGC worker thread starts\n",timestamp); } jrts$target:::rtgc-worker-thread-stop { printf("%d : RTGC worker thread stops\n",timestamp); } jrts$target:::rtgc-policy-stats { printf("%d : RTGC completed a priority %d with end free bytes = %d, min free bytes = %d, margin for next mode = %d, next critical threshold = %d, next normal threshold = %d, RTGCCriticalReservedBytes = %d\n", timestamp,arg0,arg1,arg2,arg3,arg4,arg5,arg6); } jrts$target:::rtgc-alloc-stats { ptr = copyin(arg0,arg1); stats = (struct rtgc_alloc_stats *)ptr; ts = timestamp; printf("%d : normal_total = %d normal_worst = %d normal_average = %d\n", ts,stats->normal_total,stats->normal_worst, stats->normal_average); printf("%d : boosted_total = %d boosted_worst = %d boosted_average = %d\n", ts,stats->boosted_total,stats->boosted_worst, stats->boosted_average); printf("%d : critical_in_critical = %d critical_critical = %d critical_worst = %d critical_worst_approx = %d critical_total = %d\n", ts,stats->critical_in_critical,stats->critical_critical, stats->critical_worst, stats->critical_worst_approx, stats->critical_total); } jrts$target:::rtheap-tlab-alloc { printf("%d : Thread %d gets new TLAB of size %d in RTHeap\n",timestamp,tid,arg0); } jrts$target:::rtheap-mem-alloc { printf("%d : Thread %d allocates %d bytes in RTHeap\n", timestamp,tid,arg0); } jrts$target:::rtheap-mem-alloc-failure { printf("%d : Thread %d get a failure while trying to allocate %d bytes in RTHeap\n", timestamp,tid,arg0); } jrts$target:::rtheap-split-alloc { printf("%d : Thread %d allocates %d bytes for split object %p in RTHeap\n", timestamp,tid,arg0,arg1); } jrts$target:::rtheap-split-alloc-failure { printf("%d : Thread %d get a failure while trying to allocate %d bytes for split object %p in RTHeap\n", timestamp,tid,arg0,arg1); } jrts$target:::rtheap-total-alloc-quantum1 { printf("%d : Total memory allocations in RTHeap : %d\n",arg0); } jrts$target:::rtheap-total-alloc-quantum2 { printf("%d : Total memory allocations in RTHeap : %d\n",arg0); } jrts$target:::rtheap-important-alloc-quantum1 { printf("%d : Total memory allocations for important threads in RTHeap : %d\n",arg0); } jrts$target:::rtheap-important-alloc-quantum2 { printf("%d : Total memory allocations for important threads in RTHeap : %d\n",arg0); } jrts$target:::rtheap-critical-alloc-quantum1 { printf("%d : Total memory allocations for critical threads in RTHeap : %d\n",arg0); } jrts$target:::rtheap-critical-alloc-quantum2 { printf("%d : Total memory allocations for critical threads in RTHeap : %d\n",arg0); }