This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Actually test cop_*_label
[perl5.git] / mydtrace.h
CommitLineData
5ac1e9b2
AA
1/* mydtrace.h
2 *
3 * Copyright (C) 2008, 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
3e2413e5
DL
16# define ENTRY_PROBE(func, file, line, stash) \
17 if (PERL_SUB_ENTRY_ENABLED()) { \
18 PERL_SUB_ENTRY(func, file, line, stash); \
5ac1e9b2
AA
19 }
20
3e2413e5
DL
21# define RETURN_PROBE(func, file, line, stash) \
22 if (PERL_SUB_RETURN_ENABLED()) { \
23 PERL_SUB_RETURN(func, file, line, stash); \
5ac1e9b2
AA
24 }
25
cb3f8189
SM
26# define PHASE_CHANGE_PROBE(new_phase, old_phase) \
27 if (PERL_PHASE_CHANGE_ENABLED()) { \
28 PERL_PHASE_CHANGE(new_phase, old_phase); \
29 }
30
5ac1e9b2
AA
31#else
32
33/* NOPs */
3e2413e5
DL
34# define ENTRY_PROBE(func, file, line, stash)
35# define RETURN_PROBE(func, file, line, stash)
cb3f8189 36# define PHASE_CHANGE_PROBE(new_phase, old_phase)
5ac1e9b2
AA
37
38#endif
39
40/*
41 * Local variables:
42 * c-indentation-style: bsd
43 * c-basic-offset: 4
44 * indent-tabs-mode: t
45 * End:
46 *
47 * ex: set ts=8 sts=4 sw=4 noet:
48 */