summaryrefslogtreecommitdiffstats
path: root/tools/memory_watcher/scripts/memprof.pl
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-09 03:40:15 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-09 03:40:15 +0000
commitefbbc4e910ffc6bfa364b6663143ac39930759fb (patch)
tree1bb27a172405ca7e87295e75388026930b271734 /tools/memory_watcher/scripts/memprof.pl
parent145d5c9f3409ddd9619b82d5c472fcbf72877501 (diff)
downloadchromium_src-efbbc4e910ffc6bfa364b6663143ac39930759fb.zip
chromium_src-efbbc4e910ffc6bfa364b6663143ac39930759fb.tar.gz
chromium_src-efbbc4e910ffc6bfa364b6663143ac39930759fb.tar.bz2
Add some information for memwatcher n00bs -- would also be good to be able to point to a wiki page.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@623 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/memory_watcher/scripts/memprof.pl')
-rw-r--r--tools/memory_watcher/scripts/memprof.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/memory_watcher/scripts/memprof.pl b/tools/memory_watcher/scripts/memprof.pl
index 67c1997..95fdd4c 100644
--- a/tools/memory_watcher/scripts/memprof.pl
+++ b/tools/memory_watcher/scripts/memprof.pl
@@ -1,5 +1,37 @@
#!/usr/bin/perl
+#
+# Given a memwatcher logfile, group memory allocations by callstack.
+#
+# Usage:
+#
+# memprof.pl <logfile>
+#
+# logfile -- The memwatcher.logXXXX file to summarize.
+#
+#
+#
+# Sample output:
+#
+# 54061617 100.00% AllocationStack::AllocationStack
+# 41975368 77.64% malloc
+# 11886592 21.99% VirtualAlloc
+# 7168000 13.26% v8::internal::OS::Allocate
+# 7168000 13.26% v8::internal::MemoryAllocator::AllocateRawMemory
+# 5976184 11.05% WebCore::V8Bridge::evaluate
+# 5767168 10.67% v8::internal::MemoryAllocator::AllocatePages
+# 5451776 10.08% WebCore::V8Proxy::initContextIfNeeded
+# ....
+#
+#
+#
+# ********
+# Note: The output is not currently sorted. To make it more legible,
+# you will want to sort numerically by the first field:
+# $ ./memprof.pl memwatcher.log3620.txt | sort -n -r
+# ********
+#
+
sub process_raw($$) {
my $file = shift;
my $filter = shift;