#!/usr/sbin/dtrace -qs /* Program: Print object szie distribution Author: Matty < matty91 at gmail dot com > Current Version: 1.0 Date: 8-29-2007 Revision History: Version 1.0 - initial release License: 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 Docs/cddl1.txt or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. Purpose: Prints a distribution with obejct sizes. Sample output: $ objectsize.d 19803 value ------------- Distribution ------------- count 8 | 0 16 |@@@@@@@@@@@@@ 95897 32 |@@@@ 31965 64 | 1 128 |@@@@ 32157 256 |@@@@ 31965 512 |@@@@@@@@@ 63932 1024 |@@@@ 31967 2048 | 0 */ dtrace:::BEGIN { printf("Object size distribution (Hit cntrl+c to display events)\n\n"); } hotspot*:::object-alloc { @objectdistribution[pid] = quantize(arg3); } dtrace:::END { printa(@objectdistribution); }