fix dtrace (as emulated with systemtap) builds on linux
authorTony Cook <tony@develop-help.com>
Fri, 7 Dec 2012 23:40:26 +0000 (10:40 +1100)
committerTony Cook <tony@develop-help.com>
Fri, 7 Dec 2012 23:40:26 +0000 (10:40 +1100)
the stap branch of the #if was passing four arguments to
OP_ENTRY_PROBE, much hilarity ensued.

Since literal strings are never passed as the name parameter we can move
OP_ENTRY_PROBE out of the conditional and avoid duplication.

mydtrace.h

index 951d177..5093f46 100644 (file)
        PERL_SUB_RETURN(tmp_func, file, line, stash);   \
     }
 
-#    define OP_ENTRY_PROBE(name)                        \
-    if (PERL_OP_ENTRY_ENABLED()) {                     \
-       const char *tmp_name = name;                    \
-       PERL_OP_ENTRY(tmp_name, file, line, stash);     \
-    }
-
 #    define LOADING_FILE_PROBE(name)                           \
     if (PERL_LOADING_FILE_ENABLED()) {                         \
        const char *tmp_name = name;                    \
        PERL_SUB_RETURN(func, file, line, stash);       \
     }
 
-#    define OP_ENTRY_PROBE(name)                       \
-    if (PERL_OP_ENTRY_ENABLED()) {                     \
-       PERL_OP_ENTRY(name);                            \
-    }
-
 #    define LOADING_FILE_PROBE(name)                           \
     if (PERL_LOADING_FILE_ENABLED()) {                         \
        PERL_LOADING_FILE(name);                                        \
 
 #  endif
 
+#  define OP_ENTRY_PROBE(name)                 \
+    if (PERL_OP_ENTRY_ENABLED()) {                     \
+       PERL_OP_ENTRY(name);                            \
+    }
+
 #  define PHASE_CHANGE_PROBE(new_phase, old_phase)      \
     if (PERL_PHASE_CHANGE_ENABLED()) {                  \
        PERL_PHASE_CHANGE(new_phase, old_phase);        \