File: 4751

package info (click to toggle)
pcp 7.1.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,748 kB
  • sloc: ansic: 1,483,656; sh: 182,366; xml: 160,462; cpp: 83,813; python: 24,980; perl: 18,327; yacc: 6,877; lex: 2,864; makefile: 2,738; awk: 165; fortran: 60; java: 52
file content (163 lines) | stat: -rwxr-xr-x 4,274 bytes parent folder | download
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
#!/bin/sh
# PCP QA Test No. 4751
# multi-threaded context-creation
#
# See also QA 953 for the non-helgrind version of the same test.
#
# check-group-exclude: iostat

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

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

# On some VMs (especially with relatively small memory configs), helgrind
# gets whacked by the kernel's OOM killer ... so don't waste our time
# even trying to run this test on machines where this has been observed.
#
# Similarly on slow VMs we sometimes also see SIGALRM while calling
# pthread_mutex_lock().  Skip these VMs also.
#
case `hostname -s`
in
    vm00|vm02|vm03|vm05|vm07|vm18|vm28|vm30|vm34|vm36)
	_notrun "multithread10 and helgrind are not happy campers on `hostname`"
	# NOTREACHED
	;;
esac

_check_valgrind
_check_helgrind
_get_libpcp_config
$multi_threaded || _notrun "No libpcp threading support"

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

# collect stderr as we go
exec 2>> $seq_full

_filter_ncpu()
{
  tee -a $seq_full | sed -e 's, [0-9]*$, NUMBER,'
}

# depending on network setup, attempts to reach a non-existant IP addr
# may report ..
# 192.0.2.10 -101 (Network is unreachable)
# or
# 192.0.2.10 -110 (Connection timed out)
# or
# 192.0.2.10 -111 (Connection refused)
# or
# 192.0.2.10 -113 (No route to host)
# so treat 'em as equivalent here ...
#
_filter_connect_fail()
{
    sed \
	-e '/^192\..*-110$/s/-110/-101/' \
	-e '/^192\..*-111$/s/-111/-101/' \
	-e '/^192\..*-113$/s/-113/-101/' \
    # end
}

# real QA test starts here
echo "=== Only one context ===" | tee -a $seq_full
date >> $seq_full
_run_helgrind src/multithread10 localhost
_filter_ncpu <$tmp.valgrind.out
if [ -s $tmp.valgrind.err ]
then
    echo "=== stderr ==="
    cat $tmp.valgrind.err
fi
date >> $seq_full

echo | tee -a $seq_full
echo "=== A couple of localhosts ===" | tee -a $seq_full
date >> $seq_full
_run_helgrind src/multithread10 localhost 127.0.0.1 localhost localhost local: local: localhost
_filter_ncpu <$tmp.valgrind.out | _filter_connect_fail
if [ -s $tmp.valgrind.err ]
then
    echo "=== stderr ==="
    cat $tmp.valgrind.err
fi
date >> $seq_full

echo | tee -a $seq_full
echo "=== A couple of unreachable hosts ===" | tee -a $seq_full
date >> $seq_full
ips=""
for i in 1 2 3 4; do
    for j in 0 1 2 3 4 5 6 7 8 9; do
        ips="$ips 192.0.2.${i}${j}"
    done
done
_run_helgrind src/multithread10 $ips
_filter_ncpu <$tmp.valgrind.out | _filter_connect_fail
if [ -s $tmp.valgrind.err ]
then
    echo "=== filtered stderr ==="
    grep -v 'warn fail multithread10' $tmp.valgrind.err
fi
date >> $seq_full

echo | tee -a $seq_full
echo "=== A mixture of archives and hosts and unreachable hosts ===" | tee -a $seq_full
ips="localhost local: localhost local: localhost local: 127.0.0.1 127.0.0.1 "
for i in 1 2 1 2 ; do
    for j in 0 1 2 3 4 5 6 7 8 9; do
        ips="$ips 192.0.2.${i}${j}"
    done
done
# a snapshot of archives as of our incept date, some of them repeated
archives="
./archives/tzchange-10-a.meta
./archives/tzchange-10-b.meta
./archives/tzchange-11-a.meta
./archives/tzchange-11-b.meta
./archives/tzchange-12-a.meta
./archives/tzchange-12-b.meta
./archives/pcp-vmstat.meta
./archives/pcp-atop-log.meta
./archives/pmiostat_mark.meta
./archives/proc.meta
./archives/procpid-encode2.meta
./archives/procpid-encode.meta
./archives/eventrec-old.meta
./archives/fcsw_indom.meta
./archives/foo+.meta
./archives/gap2.meta
./archives/gap.meta
./archives/gmt-boring.meta
./archives/instant-1.meta
./archives/instant-base.meta
./archives/interpmark.meta
./archives/kenj-pc-1.meta
./archives/kenj-pc-2.meta
./archives/kenj-pc-diskstat.meta
./archives/20041125.meta
./archives/20071023-08-06-36.meta
./archives/20101004-trunc.meta
./archives/20130706.meta
./archives/20150105.17.57-00.meta
./archives/20150105.17.57.meta
"
date >> $seq_full
_run_helgrind --sudo src/multithread10 $archives $ips $archives $ips
_filter_ncpu <$tmp.valgrind.out | _filter_connect_fail
if [ -s $tmp.valgrind.err ]
then
    echo "=== filtered stderr ==="
    grep -v 'warn fail multithread10' $tmp.valgrind.err
fi
date >> $seq_full

# success, all done
exit