summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-12-19 15:53:07 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2013-12-20 13:40:17 +0530
commit1e31c33d89088a4c605274b1f29167a8d9e17852 (patch)
tree1f6687062242bf772d8e3da3e5dc1849376a371d /common
parent97e78cfdb81b04e19bad4290af74de5cd411d77c (diff)
is-cpu-isolated: Use Tick count of last loop
We are calculating time interval between ticks here. Currently it happens this way: 1. Start Count 2. End Count 3. Take time difference between two 4. Repeat above three again. The problem here is that we do a Start Count almost just after End Count. And this can take a lot of time, i.e. equal to the time CPU is isolated. Which is around 40 seconds for now. So change this logic to do following: 1. Start Count 2. End Count 3. Take time difference between two 4. Start Time = End Time 5. Repeat 2->4 again. Change-Id: I455c9d5182c2ca43544848a6524a61580fe56cc4 Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'common')
-rwxr-xr-xcommon/scripts/is-cpu-isolated.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/common/scripts/is-cpu-isolated.sh b/common/scripts/is-cpu-isolated.sh
index 56da51c..c1802aa 100755
--- a/common/scripts/is-cpu-isolated.sh
+++ b/common/scripts/is-cpu-isolated.sh
@@ -45,24 +45,25 @@ get_isolation_duration() {
new_count=$(get_tick_count)
isdebug echo "initial count: " $new_count
+ old_count=$new_count
+ while [ $new_count -eq $old_count ]
+ do
+ new_count=$(get_tick_count)
+ done
+
+ isdebug echo "count locked: " $new_count
+
+ # Get time as a UNIX timestamp (seconds elapsed since Jan 1, 1970 0:00 UTC)
+ T2="$(date +%s)"
+
x=0
while [ $x -lt $sample_count ]
do
let x=x+1
- old_count=$new_count
- while [ $new_count -eq $old_count ]
- do
- new_count=$(get_tick_count)
- done
-
- isdebug echo "count locked: " $new_count
-
old_count=$new_count;
- # Get time as a UNIX timestamp (seconds elapsed since Jan 1, 1970 0:00 UTC)
- T1="$(date +%s)"
-
+ T1=$T2
isdebug echo "Start Time in seconds: ${T1}"
# sometimes there are continuous ticks, skip them.