1 #!/usr/sbin/dtrace -ZCs
3 * tcl_ins.d - count Tcl instructions using DTrace.
4 * Written for the Tcl DTrace provider.
6 * $Id: tcl_ins.d 64 2007-10-04 08:35:29Z claire $
8 * This traces activity from all Tcl processes on the system with DTrace
9 * provider support (tcl8.4.16).
11 * USAGE: tcl_calls.d # hit Ctrl-C to end
15 * TYPE Type of call (see below)
17 * COUNT Number of calls during sample
22 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
26 * The contents of this file are subject to the terms of the
27 * Common Development and Distribution License, Version 1.0 only
28 * (the "License"). You may not use this file except in compliance
31 * You can obtain a copy of the license at Docs/cddl1.txt
32 * or http://www.opensolaris.org/os/licensing.
33 * See the License for the specific language governing permissions
34 * and limitations under the License.
38 * 09-Sep-2007 Brendan Gregg Created this.
41 #pragma D option quiet
45 printf("Tracing... Hit Ctrl-C to end.\n");
50 @calls[pid, "inst", copyinstr(arg0)] = count();
55 printf(" %6s %-8s %-52s %8s\n", "PID", "TYPE", "NAME", "COUNT");
56 printa(" %6d %-8s %-52s %@8d\n", @calls);