|
@@ -29,6 +29,7 @@ fi
|
|
|
|
|
|
# task vars
|
|
# task vars
|
|
build_debug=false
|
|
build_debug=false
|
|
|
|
+build_profile=false
|
|
build_release=false
|
|
build_release=false
|
|
|
|
|
|
test_debug=false
|
|
test_debug=false
|
|
@@ -44,7 +45,7 @@ export CMAKE_EXPORT_COMPILE_COMMANDS=true
|
|
|
|
|
|
# parsing
|
|
# parsing
|
|
if [ "$task" = "clean" ]; then
|
|
if [ "$task" = "clean" ]; then
|
|
- rm -rf build_debug build_release install
|
|
+ rm -rf build_debug build_profile build_release install
|
|
elif [ "$task" = "build" ]; then
|
|
elif [ "$task" = "build" ]; then
|
|
type=$2
|
|
type=$2
|
|
if [ "$type" = "debug" ]; then
|
|
if [ "$type" = "debug" ]; then
|
|
@@ -101,7 +102,7 @@ elif [ "$task" = "valgrind" ]; then
|
|
fi
|
|
fi
|
|
valgrind="valgrind"
|
|
valgrind="valgrind"
|
|
elif [ "$task" = "performance" ]; then
|
|
elif [ "$task" = "performance" ]; then
|
|
- build_release=true
|
|
+ build_profile=true
|
|
performance=true
|
|
performance=true
|
|
elif [ "$task" = "time" ]; then
|
|
elif [ "$task" = "time" ]; then
|
|
build_release=true
|
|
build_release=true
|
|
@@ -127,6 +128,9 @@ buildProfile() {
|
|
if $build_debug; then
|
|
if $build_debug; then
|
|
buildProfile build_debug -DCMAKE_BUILD_TYPE=Debug
|
|
buildProfile build_debug -DCMAKE_BUILD_TYPE=Debug
|
|
fi
|
|
fi
|
|
|
|
+if $build_profile; then
|
|
|
|
+ buildProfile build_profile -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
|
|
+fi
|
|
if $build_release; then
|
|
if $build_release; then
|
|
buildProfile build_release -DCMAKE_BUILD_TYPE=Release
|
|
buildProfile build_release -DCMAKE_BUILD_TYPE=Release
|
|
fi
|
|
fi
|
|
@@ -158,8 +162,11 @@ if $test_release; then
|
|
cd ..
|
|
cd ..
|
|
fi
|
|
fi
|
|
if $performance; then
|
|
if $performance; then
|
|
- cd build_release
|
|
+ cd build_profile
|
|
- ./performance
|
|
+ user=$(whoami)
|
|
|
|
+ sudo perf record ./performance
|
|
|
|
+ sudo chown $user:$user perf.data
|
|
|
|
+ perf report
|
|
cd ..
|
|
cd ..
|
|
fi
|
|
fi
|
|
if $time; then
|
|
if $time; then
|