Add dtrace support
[p5sagit/p5-mst-13.2.git] / cop.h
diff --git a/cop.h b/cop.h
index 39dc9cb..0b63c67 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -132,6 +132,7 @@ typedef struct jmpenv JMPENV;
 #define CATCH_SET(v)           (PL_top_env->je_mustcatch = (v))
 
 
+#include "mydtrace.h"
 
 struct cop {
     BASEOP
@@ -295,6 +296,10 @@ struct block_sub {
  * decremented by LEAVESUB, the other by LEAVE. */
 
 #define PUSHSUB_BASE(cx)                                               \
+       ENTRY_PROBE(GvENAME(CvGV(cv)),                                  \
+               CopFILE((COP*)CvSTART(cv)),                             \
+               CopLINE((COP*)CvSTART(cv)));                            \
+                                                                       \
        cx->blk_sub.cv = cv;                                            \
        cx->blk_sub.olddepth = CvDEPTH(cv);                             \
        cx->blk_sub.hasargs = hasargs;                                  \
@@ -342,6 +347,10 @@ struct block_sub {
 
 #define POPSUB(cx,sv)                                                  \
     STMT_START {                                                       \
+       RETURN_PROBE(GvENAME(CvGV((CV*)cx->blk_sub.cv)),                \
+               CopFILE((COP*)CvSTART((CV*)cx->blk_sub.cv)),            \
+               CopLINE((COP*)CvSTART((CV*)cx->blk_sub.cv)));           \
+                                                                       \
        if (cx->blk_sub.hasargs) {                                      \
            POP_SAVEARRAY();                                            \
            /* abandon @_ if it got reified */                          \