aboutsummaryrefslogtreecommitdiff
path: root/tests/tunerscripts/measure-tuning-time.awk
blob: e7febcf164cac0e74e138a09660ea4b96f72c909 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Awk script to measure tuning time statistics from logcat dump

BEGIN {
  n = 0;
  sum = 0;
}

# Collect tuning time with "Video available in <time> ms" message
/Video available in/ {
  n++;
  tune_time = $11;
  sum += tune_time;
  if (n == 1) {
    min = tune_time;
    max = tune_time;
  } else {
    if (tune_time < min) {
      min = tune_time
    }
    if (tune_time > max) {
      max = tune_time
    }
  }
}

END {
  average = sum / n;
  print "Average tune time", average, "ms";
  print "Minimum tune time", min, "ms";
  print "Maximum tune time", max, "ms";
}