rb_flow.d revision 1
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * rb_flow.d - snoop Ruby execution showing method flow using DTrace.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * Written for the Ruby DTrace provider.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * $Id: rb_flow.d 41 2007-09-17 02:20:10Z brendan $
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * This traces activity from all Ruby programs on the system that are
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * running with Ruby provider support.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * USAGE: rb_flow.d # hit Ctrl-C to end
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * TIME(us) Time since boot, us
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * FILE Filename that this method belongs to
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * CLASS::METHOD Ruby classname and method
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * -> method entry
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * <- method return
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * Filename and method names are printed if available.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * WARNING: Watch the first column carefully, it prints the CPU-id. If it
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * changes, then it is very likely that the output has been shuffled.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * CDDL HEADER START
0e2f85c75c270eec9d148bab17911441d8843a2aJake Feasel * The contents of this file are subject to the terms of the
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * Common Development and Distribution License, Version 1.0 only
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * (the "License"). You may not use this file except in compliance
352c411653c48af103d64372adc7832043da4257Elizabeth Browne * with the License.
352c411653c48af103d64372adc7832043da4257Elizabeth Browne * You can obtain a copy of the license at Docs/cddl1.txt
352c411653c48af103d64372adc7832043da4257Elizabeth Browne * or http://www.opensolaris.org/os/licensing.
352c411653c48af103d64372adc7832043da4257Elizabeth Browne * See the License for the specific language governing permissions
352c411653c48af103d64372adc7832043da4257Elizabeth Browne * and limitations under the License.
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * CDDL HEADER END
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne * 09-Sep-2007 Brendan Gregg Created this.
0e2f85c75c270eec9d148bab17911441d8843a2aJake Feasel printf("%3s %-16s %-22s -- %s\n", "C", "TIME(us)", "FILE",
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne "CLASS::METHOD");
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne printf("%3d %-16d %-22s %*s-> %s::%s\n", cpu, timestamp / 1000,
d1a2899a06be1eab885056aeda85adcd67c010b0Jason Browne basename(copyinstr(arg2)), self->depth * 2, "", copyinstr(arg0),
0e2f85c75c270eec9d148bab17911441d8843a2aJake Feasel printf("%3d %-16d %-22s %*s<- %s::%s\n", cpu, timestamp / 1000,