1 #!/usr/sbin/dtrace -ZCs
3 * tcl_calls.d - count Tcl calls (proc/cmd) using DTrace.
4 * Written for the Tcl DTrace provider.
6 * $Id: tcl_calls.d 63 2007-10-04 04:34:38Z brendan $
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)
16 * NAME Name of proc or cmd call
17 * COUNT Number of calls during sample
23 * PORTIONS: Copyright (c) 2007 Brendan Gregg.
27 * The contents of this file are subject to the terms of the
28 * Common Development and Distribution License, Version 1.0 only
29 * (the "License"). You may not use this file except in compliance
32 * You can obtain a copy of the license at Docs/cddl1.txt
33 * or http://www.opensolaris.org/os/licensing.
34 * See the License for the specific language governing permissions
35 * and limitations under the License.
39 * 09-Sep-2007 Brendan Gregg Created this.
42 #pragma D option quiet
46 printf("Tracing... Hit Ctrl-C to end.\n");
51 @calls[pid, "proc", copyinstr(arg0)] = count();
56 @calls[pid, "cmd", copyinstr(arg0)] = count();
61 printf(" %6s %-8s %-52s %8s\n", "PID", "TYPE", "NAME", "COUNT");
62 printa(" %6d %-8s %-52s %@8d\n", @calls);