summaryrefslogtreecommitdiffstats
path: root/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io')
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup0
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d32
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d65
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d38
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d66
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d47
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d38
-rw-r--r--src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d39
8 files changed, 325 insertions, 0 deletions
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/Makefile.kup
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d
new file mode 100644
index 00000000..44bce364
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/applicat.d
@@ -0,0 +1,32 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+io:::start
+/execname == "soffice.bin" && args[2]->fi_name == "applicat.rdb"/
+{
+ @ = lquantize(args[2]->fi_offset != -1 ?
+ args[2]->fi_offset / (1000 * 1024) : -1, 0, 1000);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d
new file mode 100644
index 00000000..6957071c
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iocpu.d
@@ -0,0 +1,65 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma D option quiet
+
+sched:::on-cpu
+/execname == "soffice.bin"/
+{
+ self->on = vtimestamp;
+}
+
+sched:::off-cpu
+/self->on/
+{
+ @time["<on cpu>"] = sum(vtimestamp - self->on);
+ self->on = 0;
+}
+
+io:::wait-start
+/execname == "soffice.bin"/
+{
+ self->wait = timestamp;
+}
+
+io:::wait-done
+/self->wait/
+{
+ @io[args[2]->fi_name] = sum(timestamp - self->wait);
+ @time["<I/O wait>"] = sum(timestamp - self->wait);
+ self->wait = 0;
+}
+
+END
+{
+ printf("Time breakdown (milliseconds):\n");
+ normalize(@time, 1000000);
+ printa(" %-50s %15@d\n", @time);
+
+ printf("\nI/O wait breakdown (milliseconds):\n");
+ normalize(@io, 1000000);
+ printa(" %-50s %15@d\n", @io);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d
new file mode 100644
index 00000000..1db6290c
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iosnoop.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%10s %58s %2s\n", "DEVICE", "FILE", "RW");
+}
+
+io:::start
+{
+ printf("%10s %58s %2s\n", args[1]->dev_statname,
+ args[2]->fi_pathname, args[0]->b_flags & B_READ ? "R" : "W");
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d
new file mode 100644
index 00000000..b5b2e7e3
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iothrough.d
@@ -0,0 +1,66 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma D option quiet
+
+io:::start
+{
+ start[args[0]->b_edev, args[0]->b_blkno] = timestamp;
+}
+
+io:::done
+/start[args[0]->b_edev, args[0]->b_blkno]/
+{
+ /*
+ * We want to get an idea of our throughput to this device in KB/sec.
+ * What we have, however, is nanoseconds and bytes. That is we want
+ * to calculate:
+ *
+ * bytes / 1024
+ * ------------------------
+ * nanoseconds / 1000000000
+ *
+ * But we can't calculate this using integer arithmetic without losing
+ * precision (the denomenator, for one, is between 0 and 1 for nearly
+ * all I/Os). So we restate the fraction, and cancel:
+ *
+ * bytes 1000000000 bytes 976562
+ * --------- * ------------- = --------- * -------------
+ * 1024 nanoseconds 1 nanoseconds
+ *
+ * This is easy to calculate using integer arithmetic; this is what
+ * we do below.
+ */
+ this->elapsed = timestamp - start[args[0]->b_edev, args[0]->b_blkno];
+ @[args[1]->dev_statname, args[1]->dev_pathname] =
+ quantize((args[0]->b_bcount * 976562) / this->elapsed);
+ start[args[0]->b_edev, args[0]->b_blkno] = 0;
+}
+
+END
+{
+ printa(" %s (%s)\n%@d\n", @);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d
new file mode 100644
index 00000000..0e0f6ac7
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/iotime.d
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma D option quiet
+
+BEGIN
+{
+ printf("%10s %58s %2s %7s\n", "DEVICE", "FILE", "RW", "MS");
+}
+
+io:::start
+{
+ start[args[0]->b_edev, args[0]->b_blkno] = timestamp;
+}
+
+io:::done
+/start[args[0]->b_edev, args[0]->b_blkno]/
+{
+ this->elapsed = timestamp - start[args[0]->b_edev, args[0]->b_blkno];
+ printf("%10s %58s %2s %3d.%03d\n", args[1]->dev_statname,
+ args[2]->fi_pathname, args[0]->b_flags & B_READ ? "R" : "W",
+ this->elapsed / 1000000, (this->elapsed / 1000) % 1000);
+ start[args[0]->b_edev, args[0]->b_blkno] = 0;
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d
new file mode 100644
index 00000000..f660b343
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whoio.d
@@ -0,0 +1,38 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma D option quiet
+
+io:::start
+{
+ @[args[1]->dev_statname, execname, pid] = sum(args[0]->b_bcount);
+}
+
+END
+{
+ printf("%10s %20s %10s %15s\n", "DEVICE", "APP", "PID", "BYTES");
+ printa("%10s %20s %10d %15@d\n", @);
+}
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d
new file mode 100644
index 00000000..6a4ffdd8
--- /dev/null
+++ b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/demo/io/whowrite.d
@@ -0,0 +1,39 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma D option quiet
+
+io:::start
+/args[0]->b_flags & B_WRITE/
+{
+ @[execname, args[2]->fi_dirname] = count();
+}
+
+END
+{
+ printf("%20s %51s %5s\n", "WHO", "WHERE", "COUNT");
+ printa("%20s %51s %5@d\n", @);
+}