diff options
Diffstat (limited to 'tools/deep_memory_profiler')
-rwxr-xr-x | tools/deep_memory_profiler/dmprof | 25 | ||||
-rwxr-xr-x | tools/deep_memory_profiler/download.sh | 12 |
2 files changed, 29 insertions, 8 deletions
diff --git a/tools/deep_memory_profiler/dmprof b/tools/deep_memory_profiler/dmprof index a2f6919..b61248d 100755 --- a/tools/deep_memory_profiler/dmprof +++ b/tools/deep_memory_profiler/dmprof @@ -19,14 +19,23 @@ COMMITTED = 1 ALLOC_COUNT = 2 FREE_COUNT = 3 NULL_REGEX = re.compile('') -PPROF_PATH = os.path.join(os.path.dirname(__file__), - os.pardir, - os.pardir, - 'third_party', - 'tcmalloc', - 'chromium', - 'src', - 'pprof') + +# If an executable pprof script is in the directory of deep_memory_profiler, +# use it. Otherwise, use tcmalloc's pprof. +# +# A pprof script in deep_memory_profiler/ is prioritized to allow packaging +# deep_memory_profiler files with a pprof script. The packaged +# deep_memory_profiler is downloaded with pprof by using download.sh. +PPROF_PATH = os.path.join(os.path.dirname(__file__), 'pprof') +if not (os.path.isfile(PPROF_PATH) and os.access(PPROF_PATH, os.X_OK)): + PPROF_PATH = os.path.join(os.path.dirname(__file__), + os.pardir, + os.pardir, + 'third_party', + 'tcmalloc', + 'chromium', + 'src', + 'pprof') # Heap Profile Dump versions diff --git a/tools/deep_memory_profiler/download.sh b/tools/deep_memory_profiler/download.sh new file mode 100755 index 0000000..312ca1f --- /dev/null +++ b/tools/deep_memory_profiler/download.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +svn checkout --force \ + http://src.chromium.org/chrome/trunk/src/tools/deep_memory_profiler \ + deep_memory_profiler + +curl -o deep_memory_profiler/pprof \ + http://src.chromium.org/chrome/trunk/src/third_party/tcmalloc/chromium/src/pprof + +chmod a+x deep_memory_profiler/pprof |