3 * pl_subcalls.d - measure Perl subroutine calls using DTrace.
4 * Written for the Perl DTrace provider.
6 * $Id: pl_subcalls.d 25 2007-09-12 09:51:58Z brendan $
8 * This traces Perl activity from all running programs on the system
9 * which support the Perl DTrace provider.
11 * USAGE: pl_subcalls.d # hit Ctrl-C to end
14 * FILE Filename that contained the subroutine
15 * SUB Perl subroutine name
16 * CALLS Subroutine calls during this sample
18 * Filename and subroutine names are printed if available.
20 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
24 * The contents of this file are subject to the terms of the
25 * Common Development and Distribution License, Version 1.0 only
26 * (the "License"). You may not use this file except in compliance
29 * You can obtain a copy of the license at Docs/cddl1.txt
30 * or http://www.opensolaris.org/os/licensing.
31 * See the License for the specific language governing permissions
32 * and limitations under the License.
36 * 09-Sep-2007 Brendan Gregg Created this.
39 #pragma D option quiet
43 printf("Tracing... Hit Ctrl-C to end.\n");
48 @subs[basename(copyinstr(arg1)), copyinstr(arg0)] = count();
53 printf(" %-32s %-32s %8s\n", "FILE", "SUB", "CALLS");
54 printa(" %-32s %-32s %@8d\n", @subs);