1 /* mydtrace.h 2 * 3 * Copyright (C) 2008, 2010, 2011 by Larry Wall and others 4 * 5 * You may distribute under the terms of either the GNU General Public 6 * License or the Artistic License, as specified in the README file. 7 * 8 * Provides macros that wrap the various DTrace probes we use. We add 9 * an extra level of wrapping to encapsulate the _ENABLED tests. 10 */ 11 12 #if defined(USE_DTRACE) && defined(PERL_CORE) 13 14 # include "perldtrace.h" 15 16 # define PERL_DTRACE_PROBE_ENTRY(cv) \ 17 if (PERL_SUB_ENTRY_ENABLED()) \ 18 Perl_dtrace_probe_call(aTHX_ cv, TRUE); 19 20 # define PERL_DTRACE_PROBE_RETURN(cv) \ 21 if (PERL_SUB_ENTRY_ENABLED()) \ 22 Perl_dtrace_probe_call(aTHX_ cv, FALSE); 23 24 # define PERL_DTRACE_PROBE_FILE_LOADING(name) \ 25 if (PERL_SUB_ENTRY_ENABLED()) \ 26 Perl_dtrace_probe_load(aTHX_ name, TRUE); 27 28 # define PERL_DTRACE_PROBE_FILE_LOADED(name) \ 29 if (PERL_SUB_ENTRY_ENABLED()) \ 30 Perl_dtrace_probe_load(aTHX_ name, FALSE); 31 32 # define PERL_DTRACE_PROBE_OP(op) \ 33 if (PERL_OP_ENTRY_ENABLED()) \ 34 Perl_dtrace_probe_op(aTHX_ op); 35 36 # define PERL_DTRACE_PROBE_PHASE(phase) \ 37 if (PERL_OP_ENTRY_ENABLED()) \ 38 Perl_dtrace_probe_phase(aTHX_ phase); 39 40 #else 41 42 /* NOPs */ 43 # define PERL_DTRACE_PROBE_ENTRY(cv) 44 # define PERL_DTRACE_PROBE_RETURN(cv) 45 # define PERL_DTRACE_PROBE_FILE_LOADING(cv) 46 # define PERL_DTRACE_PROBE_FILE_LOADED(cv) 47 # define PERL_DTRACE_PROBE_OP(op) 48 # define PERL_DTRACE_PROBE_PHASE(phase) 49 50 #endif 51 52 /* 53 * ex: set ts=8 sts=4 sw=4 et: 54 */ 55