3 # test pmlogger with pmcpp integration
5 # Copyright (c) 2015 Ken McDonell. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 status
=1 # failure is the default!
17 $sudo rm -rf $tmp.
* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
22 # Dump optfetch structures from 0x7f56fa4bec30 next=0x7f56fa4bf3f0
25 # 60.0.20 (kernel.all.cpu.user):
26 # 60.0.33 (hinv.ndisk):
27 # 60.0.25 (disk.all.write):
33 -e "s@$PCP_BINADM_DIR@PCP_BINADM_DIR@g" \
34 -e "s@$PCP_VAR_DIR@PCP_VAR_DIR@g" \
35 -e '/(kernel\./s/[0-9.][0-9]*/PMID/' \
36 -e '/(hinv\./s/[0-9.][0-9]*/PMID/' \
37 -e '/(disk\./s/[0-9.][0-9]*/PMID/' \
39 /^Dump optfetch structures/ { print "Dump optfetch structures ..."
43 skip == 1 && NF == 0 { skip = 0 }
47 cat <<End-of-File >$tmp.config
48 # based on pmlogger(1) man page
49 log mandatory on once { hinv.ndisk }
50 log mandatory on every 10 minutes {
51 kernel.all.cpu.user # singular
53 sample.long # non-terminal
54 sample.bin [ "bin-100" "bin-300" "bin-500" "bin-700" ] # instances
57 log mandatory on every 15 secs {
58 network.interface.out.packets [ "no-such-interface" ] # bad instance
60 log mandatory on every 15 secs {
63 log mandatory on every 15 secs {
64 sample.string.write_me [ "?" ] # no instance for singular
67 %include "$tmp.macros.default"
70 log mandatory on %disk_all_freq {
73 log mandatory on %disk_all_freq {
74 %disk_all.read [ "nodisk" ]
79 # real QA test starts here
80 cat <<End-of-File >$tmp.macros.default
83 pmlogger
-Dlog -C -c $tmp.config
$tmp 2>&1 | _filter
86 echo "=== now with disk_all defined ==="
87 cat <<End-of-File >$tmp.macros.default
88 %define disk_all disk.all
89 %define disk_all_freq 20sec
91 pmlogger
-Dlog -C -c $tmp.config
$tmp >$tmp.out
2>$tmp.err
92 echo "--- stdout ---" >>$here/$seq.full
93 cat $tmp.out
>>$here/$seq.full
94 echo "--- stderr ---" >>$here/$seq.full
95 cat $tmp.err
>>$here/$seq.full
96 cat $tmp.out
$tmp.err | _filter