summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorAnthony King <anthonydking@slimroms.net>2015-04-30 22:19:48 +0100
committerAdnan Begovic <adnan@cyngn.com>2015-10-09 17:09:33 -0700
commit40b093fb46615812dc9b46b60cd58f1626f9e0b5 (patch)
treeecd26835b903a426e19ab0b162c39515c59b7b34 /envsetup.sh
parentccc711c7bb41a1e60750c5dbb04846d8ee3d5dc5 (diff)
downloadbuild-40b093fb46615812dc9b46b60cd58f1626f9e0b5.zip
build-40b093fb46615812dc9b46b60cd58f1626f9e0b5.tar.gz
build-40b093fb46615812dc9b46b60cd58f1626f9e0b5.tar.bz2
envsetup: add mk_timer
this wraps around any method call, mainly for 'make'. mka needs this on linux, since ionice and schedtool don't respect functions Change-Id: If8cdd235ed9eba377dd90ab8b12e93036a377ea5
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/envsetup.sh b/envsetup.sh
index a0dbf3d..4d9c58f 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -2092,7 +2092,7 @@ function mka() {
make -j `sysctl hw.ncpu|cut -d" " -f2` "$@"
;;
*)
- schedtool -B -n 1 -e ionice -n 1 make -j$(cat /proc/cpuinfo | grep "^processor" | wc -l) "$@"
+ mk_timer schedtool -B -n 1 -e ionice -n 1 make -j$(cat /proc/cpuinfo | grep "^processor" | wc -l) "$@"
;;
esac
}
@@ -2298,10 +2298,10 @@ function get_make_command()
echo command make
}
-function make()
+function mk_timer()
{
local start_time=$(date +"%s")
- $(get_make_command) "$@"
+ $@
local ret=$?
local end_time=$(date +"%s")
local tdiff=$(($end_time-$start_time))
@@ -2336,6 +2336,11 @@ function make()
return $ret
}
+function make()
+{
+ mk_timer $(get_make_command) "$@"
+}
+
if [ "x$SHELL" != "x/bin/bash" ]; then
case `ps -o command -p $$` in
*bash*)