This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlapi: Remove per-thread section; move to real scns
[perl5.git] / mydtrace.h
CommitLineData
5ac1e9b2
AA
1/* mydtrace.h
2 *
2eee27d7 3 * Copyright (C) 2008, 2010, 2011 by Larry Wall and others
5ac1e9b2
AA
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
3f6bd23a
DM
16# define PERL_DTRACE_PROBE_ENTRY(cv) \
17 if (PERL_SUB_ENTRY_ENABLED()) \
18 Perl_dtrace_probe_call(aTHX_ cv, TRUE);
ee3ace03 19
3f6bd23a
DM
20# define PERL_DTRACE_PROBE_RETURN(cv) \
21 if (PERL_SUB_ENTRY_ENABLED()) \
22 Perl_dtrace_probe_call(aTHX_ cv, FALSE);
32aeab29 23
3f6bd23a
DM
24# define PERL_DTRACE_PROBE_FILE_LOADING(name) \
25 if (PERL_SUB_ENTRY_ENABLED()) \
26 Perl_dtrace_probe_load(aTHX_ name, TRUE);
32aeab29 27
3f6bd23a
DM
28# define PERL_DTRACE_PROBE_FILE_LOADED(name) \
29 if (PERL_SUB_ENTRY_ENABLED()) \
30 Perl_dtrace_probe_load(aTHX_ name, FALSE);
ee3ace03 31
3f6bd23a
DM
32# define PERL_DTRACE_PROBE_OP(op) \
33 if (PERL_OP_ENTRY_ENABLED()) \
34 Perl_dtrace_probe_op(aTHX_ op);
2f445b24 35
3f6bd23a
DM
36# define PERL_DTRACE_PROBE_PHASE(phase) \
37 if (PERL_OP_ENTRY_ENABLED()) \
38 Perl_dtrace_probe_phase(aTHX_ phase);
cb3f8189 39
5ac1e9b2
AA
40#else
41
42/* NOPs */
3f6bd23a
DM
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)
5ac1e9b2
AA
49
50#endif
51
52/*
14d04a33 53 * ex: set ts=8 sts=4 sw=4 et:
5ac1e9b2 54 */