best way to study it is to read it in conjunction with poking at Perl
source, and we'll do that later on.
-Gisle Aas's illustrated perlguts (aka: illguts) is wonderful, although
-a little out of date wrt some size details; the various SV structures
-have since been reworked for smaller memory footprint. The
-fundamentals are right however, and the pictures are very helpful.
+Gisle Aas's illustrated perlguts (also known as I<illguts>) is wonderful,
+although a little out of date with regard to some size details; the
+various SV structures have since been reworked for smaller memory footprint.
+The fundamentals are right however, and the pictures are very helpful.
-http://www.perl.org/tpc/1998/Perl_Language_and_Modules/Perl%20Illustrated/
+L<http://www.perl.org/tpc/1998/Perl_Language_and_Modules/Perl%20Illustrated/>
=item L<perlxstut> and L<perlxs>
them out), but it basically works that way. Everything else lives in
F<t/>.
+If you add a new test directory under F<t/>, it is imperative that you
+add that directory to F<t/HARNESS> and F<t/TEST>.
+
=over 3
=item F<t/base/>
through logging functions, which is handy for breakpoint setting.
Unless C<-DPERL_MEM_LOG_NOIMPL> is also compiled, the logging
-functions read ENV{PERL_MEM_LOG} to determine whether to log the
+functions read $ENV{PERL_MEM_LOG} to determine whether to log the
event, and if so how:
- ENV{PERL_MEM_LOG} =~ /m/ Log all memory ops
- ENV{PERL_MEM_LOG} =~ /s/ Log all SV ops
- ENV{PERL_MEM_LOG} =~ /t/ include timestamp in Log
- ENV{PERL_MEM_LOG} =~ /^(\d+)/ write to FD given (default is 2)
+ $ENV{PERL_MEM_LOG} =~ /m/ Log all memory ops
+ $ENV{PERL_MEM_LOG} =~ /s/ Log all SV ops
+ $ENV{PERL_MEM_LOG} =~ /t/ include timestamp in Log
+ $ENV{PERL_MEM_LOG} =~ /^(\d+)/ write to FD given (default is 2)
Memory logging is somewhat similar to C<-Dm> but is independent of
C<-DDEBUGGING>, and at a higher level; all uses of Newx(), Renew(),
-and Safefree() are logged with the callers source code file and line
+and Safefree() are logged with the caller's source code file and line
number (and C function name, if supported by the C compiler). In
contrast, C<-Dm> is directly at the point of C<malloc()>. SV logging
is similar.
quick hint:
- $ sh Configure -des -Dusedevel -Doptimize='-g' -Accflags='-pg' -Aldflags='-pg' && make
- $ ./perl someprog # creates gmon.out in current directory
- $ gprof perl > out
+ $ sh Configure -des -Dusedevel -Doptimize='-pg' && make perl.gprof
+ $ ./perl.gprof someprog # creates gmon.out in current directory
+ $ gprof ./perl.gprof > out
$ view out
=head2 GCC gcov Profiling