summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-05-06 15:06:24 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-05-09 12:35:51 +0200
commit05d58451a1221ba95db8fb1d159eb0f76dbafb22 (patch)
tree90f534e4dab3a1969769506cafad67afec6315bd /tools
parente92fe29016300e7ae9ccfa6e9cf5422456f57e25 (diff)
Add profiling of CPU and memory usage (#912)
Diffstat (limited to 'tools')
-rwxr-xr-xtools/travis-ci/run.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh
index e59bdc06..35d2473e 100755
--- a/tools/travis-ci/run.sh
+++ b/tools/travis-ci/run.sh
@@ -346,4 +346,23 @@ if [ "${OPJ_CI_PERF_TESTS:-}" == "1" ]; then
cd ../..
fi
+if [ "${OPJ_CI_PROFILE:-}" == "1" ]; then
+ rm -rf build_gprof
+ mkdir build_gprof
+ cd build_gprof
+ # We need static linking for gprof
+ cmake "-DCMAKE_C_FLAGS=-pg -O3" -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg -DBUILD_SHARED_LIBS=OFF ..
+ make -j3
+ cd ..
+ build_gprof/bin/opj_decompress -i data/input/nonregression/kodak_2layers_lrcp.j2c -o out.tif > /dev/null
+ echo "Most CPU consuming functions:"
+ gprof build_gprof/bin/opj_decompress gmon.out | head || true
+
+ rm -f massif.out.*
+ valgrind --tool=massif build/bin/opj_decompress -i data/input/nonregression/kodak_2layers_lrcp.j2c -o out.tif >/dev/null 2>/dev/null
+ echo ""
+ echo "Memory consumption profile:"
+ python tests/profiling/filter_massif_output.py massif.out.*
+fi
+
exit ${OPJ_CI_RESULT}