diff options
author | gnn <gnn@FreeBSD.org> | 2012-05-12 20:38:18 +0000 |
---|---|---|
committer | gnn <gnn@FreeBSD.org> | 2012-05-12 20:38:18 +0000 |
commit | 4297c1b2d07fec7f50b70e26e3adb4d062b19e15 (patch) | |
tree | aec2772e8855e6dbaea6d8136ed0c47bcb825dee /Code/Perl | |
parent | 111c75a23278cd9317f0a13867c22ee0f6c95b26 (diff) | |
download | FreeBSD-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 'Code/Perl')
-rwxr-xr-x | Code/Perl/func_abc.pl | 20 | ||||
-rwxr-xr-x | Code/Perl/func_malloc.pl | 18 | ||||
-rwxr-xr-x | Code/Perl/func_slow.pl | 20 | ||||
-rwxr-xr-x | Code/Perl/hello.pl | 3 | ||||
-rwxr-xr-x | Code/Perl/hello_strict.pl | 5 |
5 files changed, 66 insertions, 0 deletions
diff --git a/Code/Perl/func_abc.pl b/Code/Perl/func_abc.pl new file mode 100755 index 0000000..394f1c2 --- /dev/null +++ b/Code/Perl/func_abc.pl @@ -0,0 +1,20 @@ +#!./perl -w + +sub func_c { + print "Function C\n"; + sleep 1; +} + +sub func_b { + print "Function B\n"; + sleep 1; + func_c(); +} + +sub func_a { + print "Function A\n"; + sleep 1; + func_b(); +} + +func_a(); diff --git a/Code/Perl/func_malloc.pl b/Code/Perl/func_malloc.pl new file mode 100755 index 0000000..5340c82 --- /dev/null +++ b/Code/Perl/func_malloc.pl @@ -0,0 +1,18 @@ +#!./perl -w + +sub func_c { + print "Function C\n"; +} + +sub func_b { + print "Function B\n"; + my $b = "B" x 100_000; + func_c(); +} + +sub func_a { + print "Function A\n"; + func_b(); +} + +func_a(); diff --git a/Code/Perl/func_slow.pl b/Code/Perl/func_slow.pl new file mode 100755 index 0000000..f32d09e --- /dev/null +++ b/Code/Perl/func_slow.pl @@ -0,0 +1,20 @@ +#!./perl -w + +sub func_c { + print "Function C\n"; + for (my $i = 0; $i < 3000000; $i++) { my $j = $i + 1; } +} + +sub func_b { + print "Function B\n"; + for (my $i = 0; $i < 2000000; $i++) { my $j = $i + 1 ; } + func_c(); +} + +sub func_a { + print "Function A\n"; + for (my $i = 0; $i < 1000000; $i++) { my $j = $i + 1; } + func_b(); +} + +func_a(); diff --git a/Code/Perl/hello.pl b/Code/Perl/hello.pl new file mode 100755 index 0000000..3ca70a2 --- /dev/null +++ b/Code/Perl/hello.pl @@ -0,0 +1,3 @@ +#!./perl + +print "Hello World!\n"; diff --git a/Code/Perl/hello_strict.pl b/Code/Perl/hello_strict.pl new file mode 100755 index 0000000..78003a9 --- /dev/null +++ b/Code/Perl/hello_strict.pl @@ -0,0 +1,5 @@ +#!./perl -w + +use strict; + +print "Hello World!\n"; |