summaryrefslogtreecommitdiffstats
path: root/Notes/ALLperl_notes.txt
diff options
context:
space:
mode:
authorgnn <gnn@FreeBSD.org>2012-05-12 20:38:18 +0000
committergnn <gnn@FreeBSD.org>2012-05-12 20:38:18 +0000
commit4297c1b2d07fec7f50b70e26e3adb4d062b19e15 (patch)
treeaec2772e8855e6dbaea6d8136ed0c47bcb825dee /Notes/ALLperl_notes.txt
parent111c75a23278cd9317f0a13867c22ee0f6c95b26 (diff)
downloadFreeBSD-src-4297c1b2d07fec7f50b70e26e3adb4d062b19e15.zip
FreeBSD-src-4297c1b2d07fec7f50b70e26e3adb4d062b19e15.tar.gz
Add the remaining scripts from the DTraceToolkit, version 0.99, to the
vendor tree. http://www.brendangregg.com/dtrace.html#DTraceToolkit
Diffstat (limited to 'Notes/ALLperl_notes.txt')
-rw-r--r--Notes/ALLperl_notes.txt44
1 files changed, 44 insertions, 0 deletions
diff --git a/Notes/ALLperl_notes.txt b/Notes/ALLperl_notes.txt
new file mode 100644
index 0000000..2403950
--- /dev/null
+++ b/Notes/ALLperl_notes.txt
@@ -0,0 +1,44 @@
+**************************************************************************
+* The following are notes for all the Perl tracing scripts,
+*
+* $Id: ALLperl_notes.txt 44 2007-09-17 07:47:20Z brendan $
+*
+* COPYRIGHT: Copyright (c) 2007 Brendan Gregg.
+**************************************************************************
+
+
+* Where did those "BEGIN" subroutine calls come from?
+
+The following counts subroutines from the example program, Code/Perl/hello.pl,
+
+ # pl_subcalls.d
+ Tracing... Hit Ctrl-C to end.
+ ^C
+ FILE SUB CALLS
+
+no subroutines were called, so there is no data to output.
+
+Now a similar program is traced, Code/Perl/hello_strict.pl, which uses
+the "strict" pragma,
+
+ # pl_subcalls.d
+ Tracing... Hit Ctrl-C to end.
+ ^C
+ FILE SUB CALLS
+ hello_strict.pl BEGIN 1
+ strict.pm bits 1
+ strict.pm import 1
+
+not only were functions from "strict.pm" traced, but a "BEGIN" function
+ran from the "hello_strict.pl" program - which doesn't appear to use "BEGIN",
+
+ # cat -n ../Code/Perl/hello_strict.pl
+ 1 #!./perl -w
+ 2
+ 3 use strict;
+ 4
+ 5 print "Hello World!\n";
+
+Perl appears to add a BEGIN block to process the "use" keyword. This makes
+some degree of sense.
+
OpenPOWER on IntegriCloud