aboutsummaryrefslogtreecommitdiff
path: root/profiling/tar-extract.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-07-01 11:42:52 +0200
committerJakob Unterwurzacher2017-07-01 11:42:52 +0200
commitb256c39271613813b94893e044df43a0730c0c13 (patch)
tree72d588aa69d99d8b119bf43ee93698b3cfefa039 /profiling/tar-extract.bash
parent52a8e14332312e7100fd6ef97c42b5f889867ade (diff)
profiling: add tar-extract helper
Extracts the linux-3.0.tar.gz tarball while capturing memory and cpu profiles.
Diffstat (limited to 'profiling/tar-extract.bash')
-rwxr-xr-xprofiling/tar-extract.bash23
1 files changed, 23 insertions, 0 deletions
diff --git a/profiling/tar-extract.bash b/profiling/tar-extract.bash
new file mode 100755
index 0000000..21b2e2b
--- /dev/null
+++ b/profiling/tar-extract.bash
@@ -0,0 +1,23 @@
+#!/bin/bash -eu
+
+cd "$(dirname "$0")"
+
+# Download /tmp/linux-3.0.tar.gz
+../tests/dl-linux-tarball.bash
+
+T=$(mktemp -d)
+mkdir $T/a $T/b
+
+../gocryptfs -init -quiet -scryptn 10 -extpass "echo test" $T/a
+../gocryptfs -quiet -extpass "echo test" -cpuprofile $T/cprof -memprofile $T/mprof \
+ $T/a $T/b
+
+# Cleanup trap
+trap "cd /; fusermount -u -z $T/b; rm -Rf $T/a" EXIT
+
+echo "Extracting..."
+time tar xzf /tmp/linux-3.0.tar.gz -C $T/b
+
+echo
+echo "Hint: go tool pprof ../gocryptfs $T/cprof"
+echo " go tool pprof -alloc_space ../gocryptfs $T/mprof"