1# Awk script to measure tuning time statistics from logcat dump 2 3BEGIN { 4 n = 0; 5 sum = 0; 6} 7 8# Collect tuning time with "Video available in <time> ms" message 9/Video available in/ { 10 n++; 11 tune_time = $11; 12 sum += tune_time; 13 if (n == 1) { 14 min = tune_time; 15 max = tune_time; 16 } else { 17 if (tune_time < min) { 18 min = tune_time 19 } 20 if (tune_time > max) { 21 max = tune_time 22 } 23 } 24} 25 26END { 27 average = sum / n; 28 print "Average tune time", average, "ms"; 29 print "Minimum tune time", min, "ms"; 30 print "Maximum tune time", max, "ms"; 31} 32 33