3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # Collect memory usage on the patches from run_stress_test
9 source "$(dirname ${0})/stress_test_common"
15 USAGE: $(basename ${0}) dir
17 Collect memory usage on the patches from run_stress_test
24 if [ ! -d "${dir}" ]; then
25 error
"\"${dir}\" not found"
29 local patches_dir
="${dir}/patches"
31 find "${patches_dir}" \
35 local subdir_filename
="${patch:$((${#patches_dir} + 1))}"
36 local out_base
="${dir}/metrics/${subdir_filename}"
37 mkdir
-p "$(dirname ${out_base})"
39 local original
="${subdir_filename%.patch}"
40 local applied
="${out_base}.applied"
41 local apply_mem
="${out_base}.apply_mem"
42 valgrind
--tool=massif
--massif-out-file="${apply_mem}" courgette
-apply \
43 "${original}" "${patch}" "${applied}" &
45 local bz2_patch
="${i}.bz2"
46 local unbz2
="${out_base}.unbz2"
47 local unbz2_mem
="${out_base}.unbz2_mem"
48 valgrind
--tool=massif
--massif-out-file="${unbz2_mem}" bunzip2
-c \
49 "${bz2_patch}" > "${unbz2}" &
51 local xz_patch
="${i}.xz"
52 local unxz
="${out_base}.unxz"
53 local unxz_mem
="${out_base}.unxz_mem"
54 valgrind
--tool=massif
--massif-out-file="${unxz_mem}" unxz
-c \
55 "${xz_patch}" > "${unxz}" &
57 local bsdiff_patch
="${patch%.patch}.bsdiff_patch"
58 local applied_bsdiff
="${out_base}.applied_bsdiff"
59 local bsdiff_mem
="${out_base}.bsdiff_mem"
60 valgrind
--tool=massif
--massif-out-file="${bsdiff_mem}" bspatch \
61 "${original}" "${applied_bsdiff}" "${bsdiff_patch}" &