summaryrefslogtreecommitdiffstats
path: root/Examples/pl_malloc_example.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 /Examples/pl_malloc_example.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 'Examples/pl_malloc_example.txt')
-rw-r--r--Examples/pl_malloc_example.txt79
1 files changed, 79 insertions, 0 deletions
diff --git a/Examples/pl_malloc_example.txt b/Examples/pl_malloc_example.txt
new file mode 100644
index 0000000..a22a008
--- /dev/null
+++ b/Examples/pl_malloc_example.txt
@@ -0,0 +1,79 @@
+The following are examples of pl_malloc.d.
+
+This is an expiremental script that attepmts to identify who is calling
+malloc() from Perl, and to print byte distribution plots.
+
+Here it traces the example program, Code/Perl/func_malloc.pl.
+
+# pl_malloc.d -c ./func_malloc.pl
+Function A
+Function B
+Function C
+Tracing... Hit Ctrl-C to end.
+
+Perl malloc byte distributions by engine caller,
+
+ perl`perl_alloc, total bytes = 1
+ value ------------- Distribution ------------- count
+ 0 | 0
+ 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 2 | 0
+
+ libc.so.1`_findbuf, total bytes = 520
+ value ------------- Distribution ------------- count
+ 256 | 0
+ 512 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 1024 | 0
+
+ perl`Perl_safesysmalloc, total bytes = 72106
+ value ------------- Distribution ------------- count
+ 1 | 0
+ 2 |@@ 26
+ 4 |@@@@@ 72
+ 8 |@@@@@@ 101
+ 16 |@@@@@@@@@@@@@@ 216
+ 32 |@@@@@@@@@@@ 178
+ 64 |@ 21
+ 128 | 6
+ 256 | 2
+ 512 | 4
+ 1024 | 1
+ 2048 |@ 11
+ 4096 | 1
+ 8192 | 0
+
+
+Perl malloc byte distributions by Perl file and subroutine,
+
+ func_malloc.pl, func_a, bytes total = 42504
+ value ------------- Distribution ------------- count
+ 16384 | 0
+ 32768 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1
+ 65536 | 0
+
+ func_malloc.pl, func_b, bytes total = 100008
+ value ------------- Distribution ------------- count
+ 2 | 0
+ 4 |@@@@@@@@@@@@@@@@@@@@ 1
+ 8 | 0
+ 16 | 0
+ 32 | 0
+ 64 | 0
+ 128 | 0
+ 256 | 0
+ 512 | 0
+ 1024 | 0
+ 2048 | 0
+ 4096 | 0
+ 8192 | 0
+ 16384 | 0
+ 32768 | 0
+ 65536 |@@@@@@@@@@@@@@@@@@@@ 1
+ 131072 | 0
+
+The func_malloc.pl program allocated around 100 Kbytes by creating a
+variable ($b) and populating it with 100,000 "b" characters. This has been
+identified in the last distribution plot printed, with one malloc event
+of between 64 Kbytes and 128 Kbytes in size. There was also a malloc event
+of between 4 and 7 bytes in size.
+
OpenPOWER on IntegriCloud