Skip to content

Commit

Permalink
Merge branch 'main' of ../pcp
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcdonell committed Nov 5, 2023
2 parents 348ccae + e7ffc13 commit 5fdaa60
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 27 deletions.
9 changes: 9 additions & 0 deletions qa/1486.out
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir="TMP/fool" ===
Expand All @@ -48,6 +49,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir='TMP/foolery' ===
Expand All @@ -73,6 +75,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir=TMP/$(TMP.foo.sh)-bar ===
Expand All @@ -98,6 +101,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir=TMP/`TMP.foo.sh`lish ===
Expand All @@ -123,6 +127,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir="TMP/foo bar" ===
Expand All @@ -148,6 +153,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir='TMP/sn afu' ===
Expand All @@ -173,6 +179,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir="TMP/$(echo mumble)-fumble" ===
Expand All @@ -198,6 +205,7 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log

=== dir='TMP/`echo foo`l-on-the-hill' ===
Expand All @@ -223,4 +231,5 @@ Log finished DATE
ARCHIVEBASE.0
ARCHIVEBASE.index
ARCHIVEBASE.meta
Latest
pmlogger.log
17 changes: 9 additions & 8 deletions qa/1901
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@ status=1 # failure is the default!
$sudo rm -rf $tmp $tmp.* $seq.full
trap "_cleanup; exit \$status" 0 1 2 3 15
mkdir -p $tmp
cd $tmp
PMLOGGER=$PCP_BIN_DIR/pmlogger
spec=qa-$seq-%Y%m%d.%H.%M

echo "== checking SIGUSR2 reexec does not leak FDs" | tee -a $seq.full
$PMLOGGER -U$username -t 2s -c config.default -l $tmp/pmlogger.log $tmp/$spec 2>$tmp/$seq.err &
echo "== checking SIGUSR2 reexec does not leak FDs" | tee -a $here/$seq.full
$PMLOGGER -U$username -t 2s -c config.default -l pmlogger.log $spec 2>$seq.err &
pid=$!
echo "pid=$pid" >>$seq.full
_wait_for_pmlogger $pid $tmp/pmlogger.log
echo "pid=$pid" >>$here/$seq.full
_wait_for_pmlogger $pid pmlogger.log
sleep 5
before=`$sudo pminfo -f proc.fd.count | awk '$2 ~ /^\['$pid'$/ {print $NF}'`
echo "before=$before" >>$seq.full
echo "before=$before" >>$here/$seq.full
$sudo -u $username kill -USR2 $pid
sleep 5
after=`$sudo pminfo -f proc.fd.count | awk '$2 ~ /^\['$pid'$/ {print $NF}'`
echo "after=$pid" >>$seq.full
echo === log === >>$seq.full; cat $tmp/pmlogger.log >>$seq.full
echo === err === >>$seq.full; cat $tmp/$seq.err >>$seq.full
echo "after=$pid" >>$here/$seq.full
echo === log === >>$here/$seq.full; cat pmlogger.log >>$here/$seq.full
echo === err === >>$here/$seq.full; cat $seq.err >>$here/$seq.full
if [ "$before" != "$after" ]
then
echo "FAILED $before not equal to $after"
Expand Down
5 changes: 5 additions & 0 deletions qa/280
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ echo "QA output created by $seq"
. ./common.filter
. ./common.check

if which realpath >/dev/null 2>&1
then
[ `realpath $PCP_ARCHIVE_DIR/$(hostname)` = "$PCP_ARCHIVE_DIR/$(hostname)" ] || _notrun "symlinks in PCP_ARCHIVE_DIR: `realpath $PCP_ARCHIVE_DIR/$(hostname)` != $PCP_ARCHIVE_DIR/$(hostname)"
fi

_filter()
{
[ -z "$PCP_PMLOGGERCONTROL_PATH" ] && \
Expand Down
12 changes: 6 additions & 6 deletions qa/655
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ cp $PCP_DIR/etc/pcp.conf $tmp.conf.backup

# real QA test starts here
iam=resctrl
_service pmcd status |& sed -e '/^Warning/d' >>$here/$seq.full
_service pmcd status 2>&1 | sed -e '/^Warning/d' >>$here/$seq.full
sleep 2
_service pmcd status |& sed -e '/^Warning/d' >>$here/$seq.full
_service pmcd stop |& _filter_pcp_stop |& sed -e '/^Warning/d'
_service pmcd status |& sed -e '/^Warning/d' >>$here/$seq.full
_service pmcd status 2>&1 | sed -e '/^Warning/d' >>$here/$seq.full
_service pmcd stop 2>&1 | _filter_pcp_stop | sed -e '/^Warning/d'
_service pmcd status 2>&1 | sed -e '/^Warning/d' >>$here/$seq.full
_wait_pmcd_end

if [ ! -d /sys/fs/resctrl/mon_data ] ; then
Expand All @@ -81,8 +81,8 @@ if [ ! -d /sys/fs/resctrl/mon_data ] ; then
echo $PCP_RESCTRL_DIR >> $tmp.conf
$sudo cp $tmp.conf $PCP_DIR/etc/pcp.conf
fi
_service pcp restart 2>&1 | _filter_pcp_start |& sed -e '/^Warning/d'
_service pmcd status |& sed -e '/^Warning/d' >>$here/$seq.full
_service pcp restart 2>&1 | _filter_pcp_start | sed -e '/^Warning/d'
_service pmcd status 2>&1 | sed -e '/^Warning/d' >>$here/$seq.full
_wait_for_pmcd

echo
Expand Down
3 changes: 2 additions & 1 deletion qa/admin/other-packages/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ slackpkg? mkfs.xfs [xfsprogs (QA optional)]
pacman? mkfs.xfs [core/xfsprogs (QA optional)]
brew? mkfs.xfs [N/A (QA optional)]
# -- java (bcc PMDA QA)
dpkg? /usr/lib/jvm/java-*/lib/server/libjvm.so [openjdk-11-jre-headless or openjdk-11-jre (QA optional)]
dpkg? /usr/lib/jvm/java-*/lib/server/libjvm.so [openjdk-[0-9][0-9]*-jre-headless or openjdk-[0-9][0-9]*-jre (QA optional)]
rpm? /usr/lib/jvm/java-*/lib/server/libjvm.so [java-latest-openjdk-headless or java-[0-9][0-9]*-openjdk-headless (QA optional)]
# -- redis (pmproxy, pmseries QA)
dpkg? redis-server [redis-server (QA optional)]
Expand Down Expand Up @@ -1574,3 +1574,4 @@ freebsd? gdiff [diffutils]
netbsd? gdiff [diffutils]
openbsd? gdiff [gdiff]
rpm? /usr/sbin/service|/sbin/service [initscripts or aaa_base]
dpkg? /usr/src/linux-headers-* [linux-headers-.*]
1 change: 1 addition & 0 deletions qa/admin/other-packages/unavailable
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CentOS 6\.10 - 389-ds apache2 avahi-utils bpftrace ccache chan-de
# 10 buster
# 11 bullseye
# ? sid (unstable)
Debian 12\..* i.86 bpfcc-tools python3-bpfcc
Debian 11\..* - apache2-mpm-worker avahi-tools libicu libreadline6-dev libsoqt-dev libsoqt-dev-common libuv-dev mariadb-client-core mysql-client-core mysql-client-core-[0-9][0-9.]* perl-modules qt4-qmake redis-cli zfsutils-linux
Debian 10\..* - apache2-mpm-worker avahi-tools kubernetes-client libreadline6-dev libsoqt5-dev libsoqt-dev libsoqt-dev-common libuv-dev mariadb-client-core mysql-client-core mysql-client-core-[0-9][0-9.]* perl-modules realpath redis-cli zfsutils-linux
Debian 10\..* i.86 bpftrace bpfcc-tools
Expand Down
6 changes: 5 additions & 1 deletion qa/admin/package-lists/Debian+12+i686
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ gfs2-utils
git
grep
iproute2
jq
kubernetes-client
libavahi-common-dev
libbpf0
libbpf1
libbpf-dev
libclass-dbi-perl
libcmocka-dev
Expand Down Expand Up @@ -107,6 +108,7 @@ python3-elasticsearch
python3-json-pointer
python3-libvirt
python3-lxml
python3-minimal
python3-openpyxl
python3-pil
python3-prometheus-client
Expand All @@ -127,11 +129,13 @@ sed
smartmontools
socat
sysstat
systemtap
systemtap-sdt-dev
time
unbound
valgrind
xfsprogs
xkb-data
zabbix-agent
zfsutils-linux
zlib1g-dev
1 change: 1 addition & 0 deletions qa/admin/package-lists/Ubuntu+22.04+x86_64
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ python3-elasticsearch
python3-json-pointer
python3-libvirt
python3-lxml
python3-minimal
python3-openpyxl
python3-pil
python3-prometheus-client
Expand Down
6 changes: 6 additions & 0 deletions qa/common.filter
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,11 @@ $1 == "inst" && $2 ~ /^\[/ {
'
}

# for src/torture_api, filter out lines like:
# hostname <s = 1>
# for the top-level PMNS nodes that come from optionaly PMDAs
# or are not present on every platform
#
_filter_torture_api()
{
sed \
Expand Down Expand Up @@ -966,6 +971,7 @@ _filter_torture_api()
-e '/^ p76 /d' \
-e '/^ process /d' \
-e '/^ quota /d' \
-e '/^ resctrl /d' \
-e '/^ roomtemp /d' \
-e '/^ rpm /d' \
-e '/^ rsyslog /d' \
Expand Down
14 changes: 3 additions & 11 deletions src/pmlogger/src/pmlogger.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,22 +720,14 @@ updateLatestFolio(const char *host, const char *base)
FILE *fp;
time_t now;
char date[26];
char dir[MAXPATHLEN];
char *logdir = pmGetConfig("PCP_ARCHIVE_DIR");
char thishost[MAXHOSTNAMELEN];

/*
* Only write the "Latest" folio if we're a pmlogger service daemon,
* i.e. pmlogger current dir is below $PCP_ARCHIVE_DIR
* Only write the "Latest" folio if we're a pmlogger service daemon
*/
if (getcwd(dir, sizeof(dir)) == NULL) {
if (!runfromcontrol) {
if (pmDebugOptions.services)
fprintf(stderr, "Info: updateLatestFolio: getcwd() failed for host %s: %s\n", host, strerror(errno));
return;
}
if (strncmp(dir, logdir, strlen(logdir)) != 0) {
if (pmDebugOptions.services)
fprintf(stderr, "Info: not creating \"Latest\" archive folio for host %s: cwd %s not below %s\n", host, dir, logdir);
fprintf(stderr, "Info: not creating \"Latest\" archive folio for host %s\n", host);
return;
}

Expand Down

0 comments on commit 5fdaa60

Please sign in to comment.