11 Commits

Author SHA1 Message Date
David Mitchell
3f6bd23a1b 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.
2016-03-18 23:45:25 +00:00
Dagfinn Ilmari Mannsåker
abec5bedac Replace common Emacs file-local variables with dir-locals
An empty cpan/.dir-locals.el stops Emacs using the core defaults for
code imported from CPAN.

Committer's work:

To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed
to be incremented in many files, including throughout dist/PathTools.

perldelta entry for module updates.

Add two Emacs control files to MANIFEST; re-sort MANIFEST.

For: RT #124119.
2015-03-22 22:36:14 -04:00
Tony Cook
2f445b24d1 fix dtrace (as emulated with systemtap) builds on linux
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.
2012-12-08 10:40:26 +11:00
Shawn M Moore
32aeab29cd "loading-file" and "loaded-file" DTrace probes 2012-08-28 07:13:56 -07:00
Shawn M Moore
fe83c362fb "op-entry" DTrace probe 2012-08-28 07:13:44 -07:00
Ricardo Signes
14d04a3346 update the editor hints for spaces, not tabs
This updates the editor hints in our files for Emacs and vim to request
that tabs be inserted as spaces.
2012-05-29 21:53:17 -04:00
Steffen Schwigon
2eee27d7b1 Bump several file copyright dates
Sync copyright dates with actual changes according to git history.

[Plus run regen_perly.h to update the SHA-256 checksums, and
regen/regcharclass.pl to update regcharclass.h]
2012-01-19 18:41:55 +01:00
Tony Cook
ee3ace03a4 workaround a type handling bug in SystemTap Dtrace 1.2
It uses a construct similar to:

  __typeof__((func)) x = func;

but hek_key is a char[1] so the above becomes:

  char arg1[1] = func;

which is invalid.

Using a temporary allows an implicit conversion to const char * and
avoids possible bugs that might be hidden by an explicit cast.
2011-08-11 17:48:10 +10:00
Shawn M Moore
cb3f81892d Add a phase-change DTrace probe 2011-07-11 20:29:55 -07:00
David Leadbeater
3e2413e5f9 [perl #80548] Add the stash name to DTrace probes
This adds an additional parameter to perl's dtrace probes with the stash
name of the subroutine. This generally looks nicer than the filename but
gives a similar level of context.

As this is an additional parameter this will not have an impact on
existing DTrace scripts. (Also due to the way DTrace works I believe it
does not break binary compatibility and would be safe to backport to
maint-5.12 if desired, but I'm not a DTrace expert.)
2010-12-10 16:09:32 -08:00
Andy Armstrong
5ac1e9b286 Add dtrace support
Message-Id: <F4AC553F-7C7F-49C3-98C2-E04681E1004F@hexten.net>

with fixups as discussed on list, plus adding usedtrace to Glossary,
plus propagating all the new config variables everywhere.
(Was there an automatic way to do that? I did it with emacs macros)

p4raw-id: //depot/perl@32953
2008-01-11 13:36:54 +00:00