Here is one of the ways that can cause these messages

junk.pm

package junk; use strict; use warnings; use Exporter qw[ import ]; our @ISA = 'Exporter'; our @EXPORT_OK = qw[ test test2 ]; sub test{ print 'test' } sub test2{ print 'test2'; goto &test; } 1;

junk.pl

#! perl -slw use strict; use junk qw[ test test2 ]; test; test2;

Profiling output

C:\test>perl -d:DProf junk.pl test test2 test C:\test>dprofpp tmon.out junk::test has 1 unstacked calls in outer junk::test2 has -1 unstacked calls in outer Total Elapsed Time = 0.014928 Seconds User+System Time = 0.015928 Seconds Exclusive Times %Time ExclSec CumulS #Calls sec/call Csec/c Name 0.00 - -0.000 1 - - strict::bits 0.00 - -0.000 1 - - warnings::BEGIN 0.00 - -0.000 1 - - warnings::import 0.00 - -0.000 2 - - junk::test 0.00 - -0.000 2 - - strict::import 0.00 - -0.000 2 - - Exporter::import 0.00 - -0.000 1 - - junk::test2 0.00 - -0.000 3 - - junk::BEGIN 0.00 - -0.000 2 - - main::BEGIN

The use of the "magic" goto in subroutine test2(), goto &test, is an optimisation that is sometimes usefully used by packages. It's effect is to transfer control from the first subroutine to the second in such a way as to ensure that when the second subroutine returns, control is transferred directly back to the original caller, rather than back through the first subroutine. This can be used to implement a form of the 'tail call optimisation'.

As dprof tracks and logs entry and exits to subroutines and then tries to match them when calculating the timing information, this one-way transfer of control confuses it's matching process and the warnings you see reflect that.

Either ignore the warnings, or use one of the line-by-line profilers which time each line, rather than each subroutine as so do not become confused. They are often more useful, though the profiling process is necessarily much slower.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: Errors when using DProf to profile by BrowserUk
in thread Errors when using DProf to profile by bowei_99

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.