3 * j_package.d - count Java class loads by package using DTrace.
4 * Written for the Java hotspot DTrace provider.
6 * $Id: j_package.d 19 2007-09-12 07:47:59Z brendan $
8 * This traces activity from all Java processes on the system with hotspot
9 * provider support (1.6.0).
11 * USAGE: j_package.d # hit Ctrl-C to end
15 * LOADS Class loads during trace
16 * PACKAGE Package name from class
18 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
22 * The contents of this file are subject to the terms of the
23 * Common Development and Distribution License, Version 1.0 only
24 * (the "License"). You may not use this file except in compliance
27 * You can obtain a copy of the license at Docs/cddl1.txt
28 * or http://www.opensolaris.org/os/licensing.
29 * See the License for the specific language governing permissions
30 * and limitations under the License.
34 * 09-Sep-2007 Brendan Gregg Created this.
37 #pragma D option quiet
41 printf("Tracing... Hit Ctrl-C to end.\n");
44 hotspot*:::class-loaded
46 this->class = (char *)copyin(arg0, arg1 + 1);
47 this->class[arg1] = '\0';
49 @loads[pid, dirname(stringof(this->class))] = count();
54 printf(" %6s %8s %s\n", "PID", "LOADS", "PACKAGE");
55 printa(" %6d %@8d %s\n", @loads);