Skip to content

Commit

Permalink
Merge branch 'main' of github.com:performancecopilot/pcp
Browse files Browse the repository at this point in the history
  • Loading branch information
natoscott committed Jul 24, 2024
2 parents b546490 + 6ea9cba commit 820fd9f
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 31 deletions.
6 changes: 1 addition & 5 deletions qa/1108
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ _cleanup()
done
cd $here

test -f $PCP_LOG_DIR/NOTICES.orig && \
$sudo mv $PCP_LOG_DIR/NOTICES.orig $PCP_LOG_DIR/NOTICES
$sudo rm -f $tmp.*
[ -f $NEEDREWRITE.$seq ] && $sudo mv $NEEDREWRITE.$seq $NEEDREWRITE
}
Expand Down Expand Up @@ -133,8 +131,6 @@ done
echo "done, now=$now" >>$seq.full

# real QA test starts here
test -f $PCP_LOG_DIR/NOTICES && \
$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.orig
$sudo $PCP_BINADM_DIR/pmlogger_daily -o -k 550 -N -c $tmp.control 2>&1 \
$sudo -u $PCP_USER -g $PCP_GROUP sh -c "umask 022; $PCP_BINADM_DIR/pmlogger_daily -o -k 550 -N -c $tmp.control" 2>&1 \
| tee -a $seq.full \
| _filter
3 changes: 0 additions & 3 deletions qa/1429
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ _cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
$sudo mv $PCP_LOG_DIR/NOTICES.$seq $PCP_LOG_DIR/NOTICES
_service pcp restart >>$seq.full 2>&1
_wait_for_pmlogger
}
Expand Down Expand Up @@ -80,8 +79,6 @@ _filter()
#
umask 022

$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.$seq

# create files for pmlogger_daily to munch on ...
#
_setup()
Expand Down
4 changes: 0 additions & 4 deletions qa/1473
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ _cleanup()
cd $here
$sudo rm -f $tmp.*
$sudo rm -rf $tmp
[ -f $PCP_LOG_DIR/NOTICES.$$ ] \
&& $sudo mv $PCP_LOG_DIR/NOTICES.$$ $PCP_LOG_DIR/NOTICES
[ -f $NEEDREWRITE.$seq ] && $sudo mv $NEEDREWRITE.$seq $NEEDREWRITE
}

Expand All @@ -134,8 +132,6 @@ $sudo rm -rf $tmp $tmp.*
# take explicit control of the umask
umask 022

[ -f $PCP_LOG_DIR/NOTICES ] \
&& $sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.$$
rm -f $seq.full
mkdir $tmp

Expand Down
1 change: 1 addition & 0 deletions qa/1478
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ mkdir $tmp
# setup a "correct" NOTICES to avoid babble from trying to
# fix this ... note this test is using pcpqa for $PCP_USER and
# $PCP_GROUP
# Note: this is $tmp/log/NOTICES, not the real NOTICES file.
#
mkdir $tmp/log
$sudo chown pcpqa:pcpqa $tmp/log
Expand Down
12 changes: 7 additions & 5 deletions qa/1484
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ $sudo rm -rf $tmp $tmp.* $seq.full
_cleanup()
{
cd $here
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"/NOTICES
$sudo rm -rf $tmp $tmp.*
}

Expand Down Expand Up @@ -81,8 +83,8 @@ echo
echo "=== \$PCP_LOG_DIR/NOTICES exists and OK, so do nothing"
mkdir "$PCP_LOG_DIR"
touch "$PCP_LOG_DIR"/NOTICES
$sudo chown pcp:pcp "$PCP_LOG_DIR"
$sudo chown pcp:pcp "$PCP_LOG_DIR"/NOTICES
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"/NOTICES
$sudo $PCP_BINADM_DIR/pcp-reboot-init 2>&1 | _filter
ls -l $tmp/log/NOTICES* 2>&1 | _myls

Expand All @@ -100,7 +102,7 @@ $sudo $PCP_BINADM_DIR/pcp-reboot-init 2>&1 \
| _filter \
| _myls
ls -l $tmp/log/NOTICES* 2>&1 | _myls
$sudo chown pcp:pcp "$PCP_LOG_DIR"
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"

echo
echo "=== \$PCP_LOG_DIR/NOTICES exists, but wrong ownership, no NOTICES.old ..."
Expand Down Expand Up @@ -130,14 +132,14 @@ $sudo $PCP_BINADM_DIR/pcp-reboot-init 2>&1 \
| _filter \
| _myls
ls -l $tmp/log/NOTICES* 2>&1 | _myls
$sudo chown pcp:pcp "$PCP_LOG_DIR"
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"

echo
echo "=== \$PCP_LOG_DIR/NOTICES exists, but wrong mode"
$sudo rm -f "$PCP_LOG_DIR"/NOTICES*
$sudo touch "$PCP_LOG_DIR"/NOTICES
$sudo chmod 666 "$PCP_LOG_DIR"/NOTICES
$sudo chown pcp:pcp "$PCP_LOG_DIR"/NOTICES
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_LOG_DIR"/NOTICES
$sudo $PCP_BINADM_DIR/pcp-reboot-init 2>&1 | _filter
ls -l $tmp/log/NOTICES* 2>&1 | _myls

Expand Down
3 changes: 0 additions & 3 deletions qa/151
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ NEEDREWRITE=$PCP_LOG_DIR/pmlogger/.NeedRewrite
_cleanup()
{
$sudo rm -rf $tmp $tmp.*
[ -f $PCP_LOG_DIR/NOTICES.$seq ] \
&& $sudo mv $PCP_LOG_DIR/NOTICES.$seq $PCP_LOG_DIR/NOTICES
[ -f $NEEDREWRITE.$seq ] && $sudo mv $NEEDREWRITE.$seq $NEEDREWRITE
}

Expand All @@ -70,7 +68,6 @@ trap "cd $here; _cleanup; exit \$status" 0 1 2 3 15
#
umask 022

$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.$seq
rm -f $seq.full
rm -rf $tmp $tmp.*
mkdir $tmp
Expand Down
3 changes: 2 additions & 1 deletion qa/300
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15

_cleanup()
{
[ -f $PCP_LOG_DIR/NOTICES.qa.$seq ] && $sudo mv $PCP_LOG_DIR/NOTICES.qa.$seq $PCP_LOG_DIR/NOTICES
_service pcp restart 2>&1 \
| _filter_pcp_start \
| sed -e '/pmlogger not running/d'
Expand Down Expand Up @@ -73,7 +74,7 @@ $sudo rm -f $PCP_VAR_DIR/pmdas/bozo/.NeedInstall*
$sudo rm -f $PCP_VAR_DIR/pmdas/bozo/.NeedRemove*
$sudo touch $PCP_VAR_DIR/pmdas/bozo/.NeedInstall
$sudo touch $PCP_VAR_DIR/pmdas/bozo/fail
$sudo rm -f $PCP_LOG_DIR/NOTICES
$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.qa.$seq
_service pcp stop >/dev/null 2>&1

# real QA test starts here
Expand Down
4 changes: 0 additions & 4 deletions qa/338
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ _cleanup()
cd $here
$sudo rm -f $tmp.*
$sudo rm -rf $tmp
[ -f $PCP_LOG_DIR/NOTICES.$$ ] \
&& $sudo mv $PCP_LOG_DIR/NOTICES.$$ $PCP_LOG_DIR/NOTICES
[ -f $NEEDREWRITE.$seq ] && $sudo mv $NEEDREWRITE.$seq $NEEDREWRITE
}

Expand All @@ -135,8 +133,6 @@ $sudo rm -rf $tmp $tmp.*
# take explicit control of the umask
umask 022

[ -f $PCP_LOG_DIR/NOTICES ] \
&& $sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.$$
rm -f $seq.full
mkdir $tmp

Expand Down
2 changes: 0 additions & 2 deletions qa/530
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ _cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
$sudo mv $PCP_LOG_DIR/NOTICES.$seq $PCP_LOG_DIR/NOTICES
[ -f $NEEDREWRITE.$seq ] && $sudo mv $NEEDREWRITE.$seq $NEEDREWRITE
}

Expand Down Expand Up @@ -95,7 +94,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
#
umask 022

$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.$seq
rm -f $seq.full

# real QA test starts here
Expand Down
2 changes: 0 additions & 2 deletions qa/532
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ _cleanup()
{
cd $here
$sudo rm -rf $tmp $tmp.*
$sudo mv $PCP_LOG_DIR/NOTICES.$seq $PCP_LOG_DIR/NOTICES
[ -f $NEEDREWRITE.$seq ] && $sudo mv $NEEDREWRITE.$seq $NEEDREWRITE
}

Expand All @@ -60,7 +59,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
#
umask 022

$sudo mv $PCP_LOG_DIR/NOTICES $PCP_LOG_DIR/NOTICES.$seq
rm -f $seq.full
rm -rf $tmp $tmp.*
mkdir $tmp
Expand Down
2 changes: 1 addition & 1 deletion src/pmcd/pmdaproc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ _setup_localhost()
# on our path
#
ping --help >$tmp/hlp 2>&1
if grep '.-c <*count>*' $tmp/hlp >/dev/null 2>&1 || grep '.-c <count>' $tmp/hlp >/dev/null 2>&1
if grep '.-c <*count>*' $tmp/hlp >/dev/null 2>&1
then
__opt='-c 1 localhost'
elif grep '.-n <*count>*' $tmp/hlp >/dev/null 2>&1
Expand Down
4 changes: 3 additions & 1 deletion src/pmdas/linux/proc_partitions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,10 +1172,12 @@ get_disk_model(char *name)
if ((fd = open(path, O_RDONLY)) >= 0) {
char buf[1024];
size = read(fd, buf, sizeof(buf)-1);
close(fd);
if (size > 0) {
buf[size-1] = '\0';
model = strdup(buf);
// TODO pmMem
if (model == NULL)
pmNoMem("get_disk_model: model", strlen(buf)+1, PM_RECOV_ERR);
return model;
}
else {
Expand Down
1 change: 1 addition & 0 deletions src/pmlogconf/zeroconf/numa
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ force include
kernel.pernode.cpu.irq.hard
kernel.pernode.cpu.irq.soft
kernel.pernode.cpu.nice
kernel.pernode.cpu.vnice
kernel.pernode.cpu.steal
kernel.pernode.cpu.sys
kernel.pernode.cpu.vuser
Expand Down

0 comments on commit 820fd9f

Please sign in to comment.