[Jifty-commit] r5435 - in Runops-Trace/trunk: .

Jifty commits jifty-commit at lists.jifty.org
Sat May 10 10:19:13 EDT 2008


Author: nothingmuch
Date: Sat May 10 10:19:11 2008
New Revision: 5435

Modified:
   Runops-Trace/trunk/Trace.xs
   Runops-Trace/trunk/lib/Runops/Trace.pm

Log:
add op mask, but no API to set it yet

Modified: Runops-Trace/trunk/Trace.xs
==============================================================================
--- Runops-Trace/trunk/Trace.xs	(original)
+++ Runops-Trace/trunk/Trace.xs	Sat May 10 10:19:11 2008
@@ -23,6 +23,10 @@
 static UNOP Runops_Trace_fakeop;
 static SV *Runops_Trace_fakeop_sv;
 
+/* op_type is 9 bits wide */
+#define OPMASK_SIZE (1 << 9) - 1
+static bool *Runops_Trace_mask;
+
 #define ARITY_NULL 0
 #define ARITY_UNARY 1
 #define ARITY_BINARY 1 << 1
@@ -38,7 +42,6 @@
 
     /* global flag controls all hooking behavior */
     if (Runops_Trace_enabled) {
-      /* no threshold set means simple hooking */
       if (Runops_Trace_hook && CALL_FPTR( Runops_Trace_hook) (aTHX))
         continue;
     }
@@ -160,6 +163,11 @@
   int ret;
   IV arity;
 
+  /* only trace enabled ops */
+  if (Runops_Trace_mask && !Runops_Trace_mask[PL_op->op_type])
+    return 0;
+
+  /* if the threshold is enabled, only trace if the op has exceeded the threshold */
   if (Runops_Trace_threshold != 0) {
     SV **count;
     UV c;

Modified: Runops-Trace/trunk/lib/Runops/Trace.pm
==============================================================================
--- Runops-Trace/trunk/lib/Runops/Trace.pm	(original)
+++ Runops-Trace/trunk/lib/Runops/Trace.pm	Sat May 10 10:19:11 2008
@@ -161,8 +161,6 @@
 
 This is useful for when you only want to trace a certain hot path.
 
-=item 
-
 =back
 
 =head1 PERL HACKS COMPATIBILITY


More information about the Jifty-commit mailing list