3 * rb_who.d - trace Ruby line execution by process using DTrace.
4 * Written for the Ruby DTrace provider.
6 * $Id: rb_who.d 49 2007-09-17 12:03:20Z brendan $
8 * This traces Ruby activity from all Ruby programs on the system that are
9 * running with Ruby provider support.
11 * USAGE: rb_who.d # hit Ctrl-C to end
14 * PID Process ID of Ruby
15 * UID User ID of the owner
16 * LINES Number of times a line was executed
17 * FILE Pathname of the Ruby program
19 * Filenames are printed if available.
21 * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
25 * The contents of this file are subject to the terms of the
26 * Common Development and Distribution License, Version 1.0 only
27 * (the "License"). You may not use this file except in compliance
30 * You can obtain a copy of the license at Docs/cddl1.txt
31 * or http://www.opensolaris.org/os/licensing.
32 * See the License for the specific language governing permissions
33 * and limitations under the License.
37 * 09-Sep-2007 Brendan Gregg Created this.
40 #pragma D option quiet
44 printf("Tracing... Hit Ctrl-C to end.\n");
49 @lines[pid, uid, copyinstr(arg0)] = count();
54 printf(" %6s %6s %10s %s\n", "PID", "UID", "LINES", "FILE");
55 printa(" %6d %6d %@10d %s\n", @lines);