r10510 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10509‎ | r10510 | r10511 >
Date:01:46, 15 August 2005
Author:kateturner
Status:old
Tags:
Comment:
some example dtrace scripts
Modified paths:
  • /trunk/phase3/maintenance/dtrace (added) (history)
  • /trunk/phase3/maintenance/dtrace/counts.d (added) (history)
  • /trunk/phase3/maintenance/dtrace/tree.d (added) (history)

Diff [purge]

Index: trunk/phase3/maintenance/dtrace/tree.d
@@ -0,0 +1,26 @@
 2+/*
 3+ * This software is in the public domain.
 4+ *
 5+ * $Id$
 6+ */
 7+
 8+#pragma D option quiet
 9+
 10+self int indent;
 11+self int times[int];
 12+
 13+php$target:::function-entry
 14+{
 15+ @counts[copyinstr(arg0)] = count();
 16+ printf("%*s", self->indent, "");
 17+ printf("-> %s\n", copyinstr(arg0));
 18+ self->times[self->indent] = timestamp;
 19+ self->indent += 2;
 20+}
 21+
 22+php$target:::function-return
 23+{
 24+ self->indent -= 2;
 25+ printf("%*s", self->indent, "");
 26+ printf("<- %s %dus\n", copyinstr(arg0), (timestamp - self->times[self->indent]) / 1000);
 27+}
Property changes on: trunk/phase3/maintenance/dtrace/tree.d
___________________________________________________________________
Added: svn:keywords
128 + Author Date Id Revision
Added: svn:eol-style
229 + native
Index: trunk/phase3/maintenance/dtrace/counts.d
@@ -0,0 +1,23 @@
 2+/*
 3+ * This software is in the public domain.
 4+ *
 5+ * $Id$
 6+ */
 7+
 8+#pragma D option quiet
 9+
 10+self int tottime;
 11+BEGIN {
 12+ tottime = timestamp;
 13+}
 14+
 15+php$target:::function-entry
 16+ @counts[copyinstr(arg0)] = count();
 17+}
 18+
 19+END {
 20+ printf("Total time: %dus\n", (timestamp - tottime) / 1000);
 21+ printf("# calls by function:\n");
 22+ printa("%-40s %@d\n", @counts);
 23+}
 24+
Property changes on: trunk/phase3/maintenance/dtrace/counts.d
___________________________________________________________________
Added: svn:keywords
125 + Author Date Id Revision
Added: svn:eol-style
226 + native

Status & tagging log