summaryrefslogtreecommitdiffstats
path: root/courgette/run_mem_test
diff options
context:
space:
mode:
authorpaulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-14 19:36:08 +0000
committerpaulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-14 19:36:08 +0000
commit80092a3286ea06759d0cd7a2b040ae2f19a50e55 (patch)
tree7026fdcbd9415007843c3e2a9a15382022f905c2 /courgette/run_mem_test
parent1819dc9a76cc6a6e559b6c900b2fa7e34f9dc430 (diff)
downloadchromium_src-80092a3286ea06759d0cd7a2b040ae2f19a50e55.zip
chromium_src-80092a3286ea06759d0cd7a2b040ae2f19a50e55.tar.gz
chromium_src-80092a3286ea06759d0cd7a2b040ae2f19a50e55.tar.bz2
Added time and memory metrics and xz compression tests
BUG=266021,205187,266028 Review URL: https://chromiumcodereview.appspot.com/22313007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217611 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette/run_mem_test')
-rwxr-xr-xcourgette/run_mem_test69
1 files changed, 69 insertions, 0 deletions
diff --git a/courgette/run_mem_test b/courgette/run_mem_test
new file mode 100755
index 0000000..07a8e5b
--- /dev/null
+++ b/courgette/run_mem_test
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+# Copyright 2013 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.
+
+# Collect memory usage on the patches from run_stress_test
+
+error() {
+ echo "error: ${@}" >&2
+}
+
+main() {
+ if [ $# -lt 1 ]; then
+ cat <<EOF
+
+USAGE: $(basename ${0}) dir
+
+Collect memory usage on the patches from run_stress_test
+
+EOF
+ exit 1
+ fi
+
+ local dir="${1}"
+ if [ ! -d "${dir}" ]; then
+ error "\"${dir}\" not found"
+ exit 1
+ fi
+
+ local patches_dir="${dir}/patches"
+
+ find "${patches_dir}" \
+ | grep "\.patch$" \
+ | while read i; do
+ local patch="${i}"
+ local subdir_filename="${patch:$((${#patches_dir} + 1))}"
+ local out_base="${dir}/metrics/${subdir_filename}"
+ mkdir -p "$(dirname ${out_base})"
+
+ local original="${subdir_filename%.patch}"
+ local applied="${out_base}.applied"
+ local apply_mem="${out_base}.apply_mem"
+ valgrind --tool=massif --massif-out-file="${apply_mem}" courgette -apply \
+ "${original}" "${patch}" "${applied}" &
+
+ local bz2_patch="${i}.bz2"
+ local unbz2="${out_base}.unbz2"
+ local unbz2_mem="${out_base}.unbz2_mem"
+ valgrind --tool=massif --massif-out-file="${unbz2_mem}" bunzip2 -c \
+ "${bz2_patch}" > "${unbz2}" &
+
+ local xz_patch="${i}.xz"
+ local unxz="${out_base}.unxz"
+ local unxz_mem="${out_base}.unxz_mem"
+ valgrind --tool=massif --massif-out-file="${unxz_mem}" unxz -c \
+ "${xz_patch}" > "${unxz}" &
+
+ local bsdiff_patch="${patch%.patch}.bsdiff_patch"
+ local applied_bsdiff="${out_base}.applied_bsdiff"
+ local bsdiff_mem="${out_base}.bsdiff_mem"
+ valgrind --tool=massif --massif-out-file="${bsdiff_mem}" bspatch \
+ "${original}" "${applied_bsdiff}" "${bsdiff_patch}" &
+
+ wait
+ done
+}
+
+main "${@}"