File: 1054

package info (click to toggle)
pcp 7.0.5-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 252,916 kB
  • sloc: ansic: 1,478,844; sh: 177,285; xml: 160,462; cpp: 83,809; python: 24,349; perl: 18,303; yacc: 6,877; lex: 2,864; makefile: 2,694; awk: 165; fortran: 60; java: 52
file content (80 lines) | stat: -rwxr-xr-x 1,554 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
#!/bin/sh
# PCP QA Test No. 1054
# pmlogger/pmcpp implementation of pmlognow
#
# Copyright (c) 2015 Ken McDonell.  All Rights Reserved.
#
# check-group-include: pmcpp

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

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

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

cat >$tmp.config <<'End-of-File'
%shell '[ -n "$PMLOGGER_ONCE" ] && echo %define PMLOGGER_ONCE; exit 0'

%ifdef PMLOGGER_ONCE
%define disk_dev_freq once
%define cpu_all_freq once
# etc ..
%else
%define disk_dev_freq '10 sec'
%define cpu_all_freq '1 sec'
# etc ..
%endif

log mandatory on %{disk_dev_freq} {
    disk.dev
}

log mandatory on %{cpu_all_freq} {
    kernel.all.cpu
}
End-of-File

_filter()
{
    $PCP_AWK_PROG '
$1 == "Group"	{ $2 = "[N"
		  print
		  skip = 1
		  next
		} 
skip == 1 && $1 == "}" {
		  print
		  skip = 0
		  next
		}
skip == 1 	{ next } 
		{ print }' \
| sed -e '/} logged /s/[0-9][0-9.]*/NNN/g'
}

# real QA test starts here
echo "once case ..." | tee -a $seq_full
PMLOGGER_ONCE=yes pmlogger -c $tmp.config -s 1 -r -l $tmp.log $tmp
pmdumplog $tmp >>$seq_full
cat $tmp.log >>$seq_full
_filter_pmlogger_log <$tmp.log \
| _filter
rm -f $tmp.0 $tmp.meta $tmp.index

echo | tee -a $seq_full
echo "other case ..." | tee -a $seq_full
pmlogger -c $tmp.config -s 4 -r -l $tmp.log $tmp
pmdumplog $tmp >>$seq_full
cat $tmp.log >>$seq_full
_filter_pmlogger_log <$tmp.log \
| _filter

# success, all done
status=0

exit