summaryrefslogtreecommitdiff
path: root/qa/419
blob: 191abf29c02b8ab3723b25f766efd23ee27cab69 (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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#! /bin/sh
# PCP QA Test No. 419
# expand non-leaf names to pmdumplog
#
# Copyright (c) 1995-2002 Silicon Graphics, Inc.  All Rights Reserved.
#

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

# get standard filters
. ./common.product
. ./common.filter
. ./common.check

rm -f $seq.out
case $PCP_PLATFORM
in
    irix|linux|darwin)
	ln $seq.$PCP_PLATFORM $seq.out || exit 1
	;;
    solaris)
	# same output config for Mac OS X and OpenSolaris
	ln $seq.darwin $seq.out || exit 1
	;;
    *)
	_notrun "Need qualified output for $PCP_PLATFORM"
	;;
esac

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

_filter()
{
    sed -n \
	-e '/No values/d' \
	-e '/):/{
s/):.*//
s/.*(//
p
}' \
    | LC_COLLATE=POSIX sort \
    | uniq -c \
    | sed -e 's/^[ 	][ 	]*/ /' \
    | $here/xlate_2_new_pmns
}

$sudo rm -f $tmp.0 $tmp.index $tmp.meta

if [ $PCP_PLATFORM = irix ]
then
    cat > $tmp.pmlogger.in <<End-of-File 
log mandatory on default {
	kernel.all.load
	kernel.all.pswitch
	kernel.all.readch
	kernel.all.writech
	kernel.all.runocc
	kernel.all.runque
	kernel.all.syscall
	kernel.all.cpu.idle
	kernel.all.cpu.intr
	kernel.all.cpu.sys
	kernel.all.cpu.sxbrk
	kernel.all.cpu.user
	kernel.all.cpu.wait.total
	kernel.all.ipc.msg
	kernel.all.ipc.sema
	disk.dev.read
	disk.dev.write
	disk.dev.total
	network.interface.in.bytes
	network.interface.out.bytes
}
End-of-File
elif [ $PCP_PLATFORM = linux ]
then
    cat > $tmp.pmlogger.in <<End-of-File
log mandatory on default {
	kernel.all.load
	kernel.all.pswitch
	kernel.all.cpu.idle
	kernel.all.cpu.intr
	kernel.all.cpu.sys
	kernel.all.cpu.user
	kernel.all.cpu.wait.total
	disk.dev.read
	disk.dev.write
	disk.dev.total
	network.interface.in.bytes
	network.interface.out.bytes
}
End-of-File
elif [ $PCP_PLATFORM = darwin -o $PCP_PLATFORM = solaris ]
then
    # same pmlogger config for Mac OS X and OpenSolaris
    cat > $tmp.pmlogger.in <<End-of-File
log mandatory on default {
	kernel.all.load
	kernel.all.cpu.idle
	kernel.all.cpu.sys
	kernel.all.cpu.user
	disk.dev.read
	disk.dev.write
	disk.dev.total
	network.interface.in.bytes
	network.interface.out.bytes
}
End-of-File
else
    echo "Arrgh ... need pmlogger config for $PCP_PLATFORM"
    exit 1
fi

pmlogger -t 2sec -T 5sec -l $tmp.log $tmp < $tmp.pmlogger.in

pmdumplog $tmp | _filter >$tmp.ref

cat $tmp.ref

# real QA test starts here
if [ $PCP_PLATFORM = irix ]
then
		for args in "kernel.all disk.dev network.interface.in network.interface.out" "kernel disk network" "kernel.all.load kernel.all.pswitch kernel.all.readch kernel.all.writech kernel.all.runocc kernel.all.runque kernel.all.syscall kernel.all.cpu.idle kernel.all.cpu.intr kernel.all.cpu.sys kernel.all.cpu.sxbrk kernel.all.cpu.user kernel.all.cpu.wait.total kernel.all.ipc.msg kernel.all.ipc.sema disk.dev.read disk.dev.write disk.dev.total network.interface.in.bytes network.interface.out.bytes"
		do
			echo
			echo "=== $args ==="
			eval pmdumplog $tmp \
			pmcd.pmlogger.host pmcd.pmlogger.port pmcd.pmlogger.archive $args \
			| _filter >$tmp.tmp
			cat $tmp.tmp
			diff $tmp.ref $tmp.tmp
		done
elif [ $PCP_PLATFORM = linux ]
then
		for args in "kernel.all disk.dev network.interface.in network.interface.out" "kernel disk network" "kernel.all.load kernel.all.pswitch kernel.all.cpu.idle kernel.all.cpu.intr kernel.all.cpu.sys kernel.all.cpu.user kernel.all.cpu.wait.total disk.dev.read disk.dev.write disk.dev.total network.interface.in.bytes network.interface.out.bytes"
		do
			echo
			echo "=== $args ==="
			eval pmdumplog $tmp \
			pmcd.pmlogger.host pmcd.pmlogger.port pmcd.pmlogger.archive $args \
			| _filter >$tmp.tmp
			cat $tmp.tmp
			diff $tmp.ref $tmp.tmp
		done
elif [ $PCP_PLATFORM = darwin -o $PCP_PLATFORM = solaris ]
then
		# same metrics for Mac OS X and OpenSolaris
		for args in "kernel.all disk.dev network.interface.in network.interface.out" "kernel disk network" "kernel.all.load kernel.all.cpu.idle kernel.all.cpu.sys kernel.all.cpu.user disk.dev.read disk.dev.write disk.dev.total network.interface.in.bytes network.interface.out.bytes"
		do
			echo
			echo "=== $args ==="
			eval pmdumplog $tmp \
			pmcd.pmlogger.host pmcd.pmlogger.port pmcd.pmlogger.archive $args \
			| _filter >$tmp.tmp
			cat $tmp.tmp
			diff $tmp.ref $tmp.tmp
		done
else
    echo "Arrgh ... need pmdumplog args for $PCP_PLATFORM"
    exit 1
fi

status=0
exit