summaryrefslogtreecommitdiff
path: root/maintenance/dtrace
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2006-10-11 18:12:39 +0000
committerPierre Schmitz <pierre@archlinux.de>2006-10-11 18:12:39 +0000
commit183851b06bd6c52f3cae5375f433da720d410447 (patch)
treea477257decbf3360127f6739c2f9d0ec57a03d39 /maintenance/dtrace
MediaWiki 1.7.1 wiederhergestellt
Diffstat (limited to 'maintenance/dtrace')
-rw-r--r--maintenance/dtrace/counts.d23
-rw-r--r--maintenance/dtrace/tree.d26
2 files changed, 49 insertions, 0 deletions
diff --git a/maintenance/dtrace/counts.d b/maintenance/dtrace/counts.d
new file mode 100644
index 00000000..13725d99
--- /dev/null
+++ b/maintenance/dtrace/counts.d
@@ -0,0 +1,23 @@
+/*
+ * This software is in the public domain.
+ *
+ * $Id: counts.d 10510 2005-08-15 01:46:19Z kateturner $
+ */
+
+#pragma D option quiet
+
+self int tottime;
+BEGIN {
+ tottime = timestamp;
+}
+
+php$target:::function-entry
+ @counts[copyinstr(arg0)] = count();
+}
+
+END {
+ printf("Total time: %dus\n", (timestamp - tottime) / 1000);
+ printf("# calls by function:\n");
+ printa("%-40s %@d\n", @counts);
+}
+
diff --git a/maintenance/dtrace/tree.d b/maintenance/dtrace/tree.d
new file mode 100644
index 00000000..2f16e41d
--- /dev/null
+++ b/maintenance/dtrace/tree.d
@@ -0,0 +1,26 @@
+/*
+ * This software is in the public domain.
+ *
+ * $Id: tree.d 10510 2005-08-15 01:46:19Z kateturner $
+ */
+
+#pragma D option quiet
+
+self int indent;
+self int times[int];
+
+php$target:::function-entry
+{
+ @counts[copyinstr(arg0)] = count();
+ printf("%*s", self->indent, "");
+ printf("-> %s\n", copyinstr(arg0));
+ self->times[self->indent] = timestamp;
+ self->indent += 2;
+}
+
+php$target:::function-return
+{
+ self->indent -= 2;
+ printf("%*s", self->indent, "");
+ printf("<- %s %dus\n", copyinstr(arg0), (timestamp - self->times[self->indent]) / 1000);
+}