File: 129

package info (click to toggle)
pcp 4.3.2%2Breally4.3.1-0.1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 175,188 kB
  • sloc: ansic: 261,305; sh: 123,606; xml: 107,279; cpp: 72,127; perl: 18,283; python: 15,453; yacc: 8,249; lex: 2,585; makefile: 1,957; fortran: 60; java: 52
file content (126 lines) | stat: -rwxr-xr-x 2,519 bytes parent folder | download | duplicates (3)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#! /bin/sh
# PCP QA Test No. 129
# pmlogreduce rate conversion
#
# Copyright (c) 2002 Silicon Graphics, Inc.  All Rights Reserved.
# 

seq=`basename $0`
echo "QA output created by $seq"

# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check

status=0	# success is the default!
$sudo rm -rf $tmp.*
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

rm -f $seq.full

_filter()
{
    sed \
	-e '/^ *$/d' \
	-e 's/  */ /g' \
	-e 's/ $//' \
	-e '/End of PCP archive log/d' \
    | $PCP_AWK_PROG '
BEGIN			{ skip = 1 }
$1 == "interval:"	{ skip = 0; next }
skip == 0		{ print }'
}

_fix_e_fmt()
{
    sed \
	-e 's/\([0-9]\)E/\1 E /' \
    | $PCP_AWK_PROG '
	{ printf "%s",$1
	  for (i = 2; i <= NF; i++) {
	    if ($(i+1) == "E") {
		b = $(i+2)
		s = 1.0
		while (b < 0) {
		    s /= 10
		    b++
		}
		while (b > 0) {
		    s *= 10
		    b--
		}
		$i *= s
		printf " %s",$i
		i += 2
	    }
	    else
		printf " %s",$i
	  }
	  print ""
	}'
}

_do()
{
    $PCP_ECHO_PROG $PCP_ECHO_N "$1""$PCP_ECHO_C"
    echo >>$seq.full
    echo "=== $1 orig ===" >>$seq.full
    pmval -z -O 1m -A 15m -t 15m -a archives/kenj-pc-1 $1 2>$tmp.orig.err \
    | tee -a $seq.full \
    | _fix_e_fmt \
    | _filter >$tmp.orig
    echo "--- stderr ---" >>$seq.full
    cat $tmp.orig.err >>$seq.full
    echo "--- filtered ---" >>$seq.full
    cat $tmp.orig >>$seq.full

    echo "=== $1 reduce ===" >>$seq.full
    pmval -z -O 15m -A 15m -t 15m -a $tmp $1 2>$tmp.reduce.err \
    | tee -a $seq.full \
    | _fix_e_fmt \
    | _filter >$tmp.reduce
    echo "--- stderr ---" >>$seq.full
    cat $tmp.reduce.err >>$seq.full
    echo "--- filtered ---" >>$seq.full
    cat $tmp.reduce >>$seq.full

    # Bizarre ... NetBSD join demands NO SPACE after -a in this usage!
    #
    join -a1 -a2 -e "?" $tmp.orig $tmp.reduce >$tmp.join

# cat $tmp.join

    $PCP_AWK_PROG <$tmp.join >$tmp.chk '
NF != 3		{ if (NR > 1) print
		  next
		}
$2 == "?"	{ print; next }
$3 == "?"	{ print; next }
		{ if (0.99*$2 <= $3 && $3 <= 1.01*$2) next }
		{ print }'

    if [ -s $tmp.chk ]
    then
	$PCP_ECHO_PROG " mismatches ..."
	echo "--- chk ---" >>$seq.full
	cat $tmp.chk >>$seq.full
	cat $tmp.orig.err
	cat $tmp.reduce.err
	diff -u $tmp.orig $tmp.reduce
    else
	$PCP_ECHO_PROG " OK"
    fi
}

# real QA test starts here
pmlogreduce -A 15m -t 15m -D appl0,appl1,appl2 archives/kenj-pc-1 $tmp 2>>$seq.full

for m in \
    disk.all.total kernel.all.cpu.idle \
    disk.dev.total kernel.percpu.cpu.user
do
    _do $m
done