diff options
author | David Mitchell <davem@iabyn.com> | 2016-02-15 13:48:24 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-03-18 23:45:25 +0000 |
commit | 3f6bd23a1b9204dda7aaaef6efe17dc87f50a675 (patch) | |
tree | 3d11776a33725904ad8cc55dd664d693a7c0b7dd /makedef.pl | |
parent | 5fa8e144165a5c086facccf35630b9c4a781c4ad (diff) | |
download | perl-3f6bd23a1b9204dda7aaaef6efe17dc87f50a675.tar.gz |
rename and function-ise dtrace macros
This commit:
1. Renames the various dtrace probe macros into a consistent and
self-documenting pattern, e.g.
ENTRY_PROBE => PERL_DTRACE_PROBE_ENTRY
RETURN_PROBE => PERL_DTRACE_PROBE_RETURN
Since they're supposed to be defined only under PERL_CORE, this shouldn't
break anything that's not being naughty.
2. Implement the main body of these macros using a real function.
They were formerly defined along the lines of
if (PERL_SUB_ENTRY_ENABLED())
PERL_SUB_ENTRY(...);
The PERL_SUB_ENTRY() part is a macro generated by the dtrace system, which
for example on linux expands to a large bunch of assembly directives.
Replace the direct macro with a function wrapper, e.g.
if (PERL_SUB_ENTRY_ENABLED())
Perl_dtrace_probe_call(aTHX_ cv, TRUE);
This reduces to once the number of times the macro is expanded.
The new functions also take simpler args and then process the values they
need using intermediate temporary vars to avoid huge macro expansions.
For example
ENTRY_PROBE(CvNAMED(cv)
? HEK_KEY(CvNAME_HEK(cv))
: GvENAME(CvGV(cv)),
CopFILE((const COP *)CvSTART(cv)),
CopLINE((const COP *)CvSTART(cv)),
CopSTASHPV((const COP *)CvSTART(cv)));
is now
PERL_DTRACE_PROBE_ENTRY(cv);
This reduces the executable size by 1K on -O2 -Dusedtrace builds,
and by 45K on -DDEBUGGING -Dusedtrace builds.
Diffstat (limited to 'makedef.pl')
-rw-r--r-- | makedef.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/makedef.pl b/makedef.pl index fd3bf62ffe..78ee0b17f5 100644 --- a/makedef.pl +++ b/makedef.pl @@ -427,6 +427,15 @@ unless ($define{'PERL_OP_PARENT'}) { ); } +unless ($define{'USE_DTRACE'}) { + ++$skip{$_} foreach qw( + Perl_dtrace_probe_call + Perl_dtrace_probe_load + Perl_dtrace_probe_op + Perl_dtrace_probe_phase + ); +} + if ($define{'NO_MATHOMS'}) { # win32 builds happen in the win32/ subdirectory, but vms builds happen # at the top level, so we need to look in two candidate locations for |