File: 1447

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 (161 lines) | stat: -rwxr-xr-x 3,207 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
#!/bin/sh
# PCP QA Test No. 1447
# derived metrics and indom mapping
#
# non-valgrind variant, see qa/1448 for the valgrind variant
#
# Copyright (c) 2023 Ken McDonell.  All Rights Reserved.
#

if [ $# -eq 0 ]
then
    seq=`basename $0`
    echo "QA output created by $seq"
else
    # use $seq from caller, unless not set
    [ -n "$seq" ] || seq=`basename $0`
    echo "QA output created by `basename $0` $*"
fi

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

do_valgrind=false
if [ "$1" = "--valgrind" ]
then
    _check_valgrind
    do_valgrind=true
elif which valgrind >/dev/null 2>&1
then
    : note we want to run both variants for this test, as the
    : valgrind variant filters away the functional checks and
    : only reports memory issues
fi

_cleanup()
{
    cd $here
    $sudo rm -rf $tmp $tmp.*
}

status=0	# success is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15

_filter()
{
    sed \
	-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z]  *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATESTAMP/' \
	-e "s@$tmp@TMP@g" \
	-e 's/pminfo([0-9][0-9]*)/pminfo(PID)/' \
	-e 's/0x[0-9a-f[0-9a-f]*/ADDR/g' \
    # end
}

# real QA test starts here

PCP_DERIVED_CONFIG=$tmp.derive; export PCP_DERIVED_CONFIG

cat <<'End-of-File' >$tmp.derive
qa.c = sample.bin + sampledso.bin
End-of-File

echo "=== syntax errors in indom.config ==="
cat <<'End-of-File' >$tmp.equiv
# comment
	# tab comment
 # space comment
# <domain> too long (<= 3 digits)
2912.1 30.1
29.1 3012.1
# <domain> too big (<= 511)
512.1 30.1
29.1 512.1
# <serial> too long (<= 9 gigits)
29.11234567 30.1
29.1 30.11234567
# <serial> too big (<= 4194303)
29.4194304 30.1
29.1 30.4194304
# <domain> and <serial> should be OK
511.4194303 29.1
30.1 511.4194303 29.1
# : not .
29:1 30.1
29.1 30:1
# x not <domain>
x.1 30.1
29.1 x.1
# x not <serial>
29.x 30.1
29.1 30.x
# non-numeric <domain>
foo.1 30.1
29.1 bar.1
29foo.1 30.1
29.1 30foo.1
# non-numeric <serial>
29.foo 30.1
29.1 30.bar
29.1x 30.1
29.1 30.1x
# incomplete line
123
# incomplete and EOF
123
End-of-File
# chop off last \n - for Coverity CID 383817
#
nch=`wc -c <$tmp.equiv | sed -e 's/  *//'`
nch=`expr $nch - 1`
dd if=$tmp.equiv of=$tmp.tmp ibs=1 count=$nch 2>>$seq_full
mv $tmp.tmp $tmp.equiv
nl -b a $tmp.equiv
PCP_INDOM_CONFIG=$tmp.equiv; export PCP_INDOM_CONFIG
if $do_valgrind
then
    _run_valgrind pminfo -v qa 2>&1
else
    pminfo -v qa 2>&1
fi \
| _filter

cat <<'End-of-File' >$tmp.derive
# singular subset <op> full indom
qa.a = sample.bin[bin-300] + sample.bin
# full indom <op> subset
qa.b = sample.bin + matchinst(/bin-[13579]00/, sample.bin)
# needs __pmEquivInDom() assistance
qa.c = sample.bin + sampledso.bin
End-of-File

cat <<'End-of-File' >$tmp.equiv
29.2 30.2
29.1 30.1 31.1 32.2 33.3
End-of-File

echo
echo '=== without mapping ==='
PCP_INDOM_CONFIG=; export PCP_INDOM_CONFIG
if $do_valgrind
then
    _run_valgrind pminfo -f qa 2>&1
else
    pminfo -f qa 2>&1
fi \
| _filter

echo
echo '=== with mapping ==='
PCP_INDOM_CONFIG=$tmp.equiv; export PCP_INDOM_CONFIG
if $do_valgrind
then
    _run_valgrind pminfo -f -Dindom qa 2>&1
else
    pminfo -f -Dindom qa 2>&1
fi \
| _filter

# success, all done
exit