From nobody Tue Jan 02 13:44:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T4DcJ1HyHz55RrD; Tue, 2 Jan 2024 13:44:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T4DcH6QRwz4fmv; Tue, 2 Jan 2024 13:44:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704203087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rm7GuWM2G4mhmo0BB+PoG8gfgxbHJLAPFogytz6RAqE=; b=jPR6kd6ZZZu5y2N7Fj4umB/DtcNVoVdbPz4WzHfNqt2kIoetcD2rtsUi0/MtdYiXZo9TIl EYDSVgCPbjyNZ2wfABZagcNPsBRMzl2g/yrMm3Xns2sa9I1ec1fro8axymMqsCYtPzGFDu 6ZOzyEMW+1iORh2dtSOnv0fupYsypKPcALXi4no5/wNoBsMNLbIXmj4fZfMdpb1seWAaFA QHeuuRcxCHjCoLG3PZqUD0geKhDAu53bfwuwl3VPLZyBSMZHwyiBy41rYvW9ppBLaqlMER z3pd7T8p8RyyqZhGBylEZVNSticcyAsTWDh9nWuOFvwWUHfiPUvsOge+zdGF7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704203087; a=rsa-sha256; cv=none; b=Bam2slpjYdeIA0s5qPZbw/zgCpfwQiM4oLFUakZZ00KqaBgRfW4gsSZb1oLttOsnXK4byS 5D6XLpGQlBI6i5Xw00j2NF6wLq2Xg5vD+0LejVc1V1wicWA6NUm+G3rUrzGdPq/vxfMfOB iHTNXymjsAknzltDMod2Kk9N0O9vVJ9L5Ig6HKRreIbhj0kqjqVZB/CY5liNROLpQilmmy j17xX9MyHr6hXK98eR86DgcExNBUqKi/JYHyO1yAppQdse/2Gh4O/tQW3UEgE4QtN33qkK bMMdrHx9aGlPCh+Da7bWrB68NVRhZX5Mgux43Vr9X5rvl7OGs3+dm6WdfCZzXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704203087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rm7GuWM2G4mhmo0BB+PoG8gfgxbHJLAPFogytz6RAqE=; b=QVn+3wgreXvFj2rZuee5J0nbXuWAUUlewSpULlRRxOMuhgav5bew3HQD7xkaulwF99VHib Fr4r8kWgq9OsanfHeif1MqX4bHnFLr1lAjJDorAel3QqFykztVgCEObRbeBa+68a2Pemep FwAxlb93GS5KD4gDTQiBcD2os7sPUXOhDLHboqlLz68FceJV8IRIU6aQ+1Y0ONSyVT38Mk e1xRHayDf6GH3fAe4fgcQxR0PtWu//RiPFY3Fj7VOh/uVRFsQ1JQneAV8j3yL5EXyHrBDC 41hgJBbz/Sed0uf/c0EYeUPwaoVNMusll+srS+bj30QsB3QD/V8c05ndTQTxnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T4DcH5DRbz12wZ; Tue, 2 Jan 2024 13:44:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 402DilX3015702; Tue, 2 Jan 2024 13:44:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 402Dilob015699; Tue, 2 Jan 2024 13:44:47 GMT (envelope-from git) Date: Tue, 2 Jan 2024 13:44:47 GMT Message-Id: <202401021344.402Dilob015699@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 1db45a406688 - main - stress2: Handle the new output format of vmstat(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1db45a406688e4bdc1f47773bc8f662b1ded2b3f Auto-Submitted: auto-generated The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=1db45a406688e4bdc1f47773bc8f662b1ded2b3f commit 1db45a406688e4bdc1f47773bc8f662b1ded2b3f Author: Peter Holm AuthorDate: 2024-01-02 13:43:46 +0000 Commit: Peter Holm CommitDate: 2024-01-02 13:43:46 +0000 stress2: Handle the new output format of vmstat(8) --- tools/test/stress2/tools/vmstat.sh | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/tools/test/stress2/tools/vmstat.sh b/tools/test/stress2/tools/vmstat.sh index 89ff1e331fc5..f7006669a7c0 100755 --- a/tools/test/stress2/tools/vmstat.sh +++ b/tools/test/stress2/tools/vmstat.sh @@ -45,34 +45,28 @@ OIFS=$IFS while true; do # Type InUse MemUse [ -z "$optm" ] && vmstat -m | sed 1d | - sed 's/\(.* \)\([0-9][0-9]*\) *\(.*\)K .*/\1:\2:\3/' | - while IFS=: read -r p1 p2 p3; do - name=`echo $p1 | sed 's/^ *//;s/ *$//'` - memuse=$p3 + while read l; do + name=`echo $l | sed -E 's/ [0-9]+ .*//; s/^ *//'` + memuse=`echo $l | sed -E "s#$name##" | \ + awk '{print int(($2 + 1023) / 1024)}'` [ "$memuse" -ne 0 ] && echo "vmstat -m $name,$memuse" - done + done # ITEM SIZE LIMIT USED - [ -z "$optz" ] && vmstat -z | - grep -vE '(rl_entry):' | - sed "1,2d;/^$/d;s/: /, /" | - sed -E 's/[^[:print:]\r\t]/ /g' | + [ -z "$optz" ] && vmstat -z | sed 1d | while read l; do - IFS=',' - set $l - [ $# -lt 8 ] && - { echo "# args must be >= 8, but is $# in $l" 1>&2; - continue; } - size=$2 - used=$4 + name=`echo $l | sed 's/:.*//'` + l=`echo $l | sed 's/.*://'` + size=`echo $l | awk -F ',' '{print $1}'` + used=`echo $l | awk -F ',' '{print $3}'` [ -z "$used" -o -z "$size" ] && { echo "used/size not set $l" 1>&2; continue; } echo $used | egrep -q '^ *[0-9]{1,10}$' || { echo "Bad used: $used. l=$l" 1>&2; continue; } tot=$((((size * used) + 1023) / 1024)) [ $tot -ne 0 ] && - echo "vmstat -z $1,$tot" - done + echo "vmstat -z $name,$tot" + done r=`sysctl -n vm.stats.vm.v_wire_count` [ -n "$r" ] && @@ -98,6 +92,7 @@ done | awk $debug -F, ' close(cmd); printf "%s \"%s\" %'\''dK\r\n", t, name, size; + fflush n[name] = 0; } s[name] = size;