1 #!/usr/bin/env awk -F, -f
6 print "Size,Scan,No Scan";
13 NR > 1 { # skip the input CVS header
15 if (int($6) > 0) { # cell has the NO_SCAN bit
19 } else { # cell doesn't have the NO_SCAN bit
31 if (val >= 1048576) # 1 M
32 r = sprintf("%uM", val / 1048576)
33 else if (val >= 1024) # 1 K
34 r = sprintf("%uK", val / 1024)
36 r = sprintf("%u", val)
40 function p(s, ns, o, n) {
41 for (i = 1; i <= n; i++)
42 print o[i] "," s[o[i]] "," ns[o[i]]
46 # reduce the number of elements in the histogram if there are too many
47 if (length(scan) > MAX_SAMPLES) {
48 step = int((max - min) / MAX_SAMPLES) + 1
51 for (from = min; from < max; from += step) {
53 if ((from <= i) && (i < to)) {
54 j = sprintf("%s-%s", h(from), h(to))
56 no_scan2[j] += no_scan[i]
62 for (from = min; from < max; from += step) {
63 v = sprintf("%s-%s", h(from), h(from + step))
70 p(scan2, no_scan2, order, n)
75 p(scan, no_scan, order, n)