The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

<html>
<head>
<title>Devel::STrace</title>
</head>
<body>
<table width='100%' border=0 CELLPADDING='0' CELLSPACING='3'>
<TR>
<TD VALIGN='top' align=left><FONT SIZE='-2'>
 SUMMARY:&nbsp;CONSTR&nbsp;|&nbsp;<A HREF='#method_summary'>METHOD</a>
 </FONT></TD>
<TD VALIGN='top' align=right><FONT SIZE='-2'>
DETAIL:&nbsp;CONSTR&nbsp;|&nbsp;<A HREF='#method_detail'>METHOD</a>
</FONT></TD>
</TR>
</table><hr>
<h2>Class Devel::STrace</h2>

<hr>

Provides a minimal strace/truss-like utility for
Perl scripts. Using <a href='http://search.cpan.org/perldoc?Devel::RingBuffer'>
Devel::RingBuffer</a>, each new subroutine call is logged to an mmap'ed shared memory
region (as provided by <a href='http://search.cpan.org/perldoc?IPC::Mmap'>IPC::Mmap</a>).
As each statement is executed, the line number and Time::HiRes:;time() timestamp
are written to the current ringbuffer slot. An external application can
then monitor a running application by inspecting the mmap'ed area (see
<a href='http://search.cpan.org/perldoc?Devel::STrace::Monitor'>Devel::STrace::Monitor</a>
and the associated plstrace.pl application for an example).
<p>
Permission is granted to use this software under the same terms as Perl itself.
Refer to the <a href='http://perldoc.perl.org/perlartistic.html'>Perl Artistic License</a>
for details.


<p>

<dl>

<dt><b>Author:</b></dt>
	<dd>D. Arnold</dd>

<dt><b>Since:</b></dt>
	<dd>2006-05-01
</dd>

<dt><b>See Also:</b></dt>
	<dd><a href='http://perldoc.perl.org/perldebguts.html'>perdebguts</a></dd>

<p>
<i>Unless otherwise noted, <code>$self
</code> is the object instance variable.</i>
<p>
<table border=1 cellpadding=3 cellspacing=0 width='100%'>
<tr bgcolor='#9800B500EB00'><th align=left><font size='+2'>Method Summary</font></th></tr>

<tr><td align=left valign=top>
<code><a href='#CLONE'>CLONE</a>()</code>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>(class method)</i> Threads clone method
</td></tr>

<tr><td align=left valign=top>
<code><a href='#DB'>DB</a>()</code>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>(class method)</i> Debug a single statement
</td></tr>

<tr><td align=left valign=top>
<code><a href='#sub'>sub</a>()</code>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>(class method)</i> Debug a subroutine call
</td></tr>
</table>
<p>

<a name='method_detail'></a>
<table border=1 cellpadding=3 cellspacing=0 width='100%'>
<tr bgcolor='#9800B500EB00'>
	<th align=left><font size='+2'>Method Details</font></th>
</tr></table>

<a name='CLONE'></a>
<h3>CLONE</h3>
<pre>
CLONE()
</pre><p>
<dl>
<dd><i>(class method)</i> Threads clone method. Allocates a new ring, and
and populates the existing cloned ring object with
the newly allocate ring information.


<p>
<dd><dl>
</dl></dd></dl><hr>

<a name='DB'></a>
<h3>DB</h3>
<pre>
DB()
</pre><p>
<dl>
<dd><i>(class method)</i> Debug a single statement. Creates a ringbuffer if none exists.
Allocates a new ring if executed in a new process. Updates
the ring's current slot with the current line number and timestamp.


<p>
<dd><dl>
</dl></dd></dl><hr>

<a name='sub'></a>
<h3>sub</h3>
<pre>
sub()
</pre><p>
<dl>
<dd><i>(class method)</i> Debug a subroutine call. If trace is enabled
in the ring, the next slot is allocated and the called
subroutine (from $DB::sub) is written to it. The subroutine
is then called with the caller's return context, and then
the slot is freed before returning. Note that this method
requires additional control to handle re-entrancy when
DB::DB() or DB::sub() make calls to the various support
functions.


<p>
<dd><dl>
<dt><b>Returns:</b><dd>The subroutine's return value(s), if the
caller is not in void context.
</dd>
</dl></dd></dl><hr>

<small>
<center>
<i>Generated by psichedoc on Sun Aug 13 09:26:08 2006</i>
</center>
</small>
</body>
</html>