From nobody Mon May 6 13:16:25 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1587653038; cv=none; d=zohomail.com; s=zohoarc; b=U1bdOl1BDAviRaA1PlMfZmWO7nb4u/5dopQaatGPMCx/heTSlfvgQeQglEoPOuUcivnZ/F3CI7VsbdqQ9wnDvJjTifxk1SXudQdVi038fPV22v4/wQXJuKsY9FGvkAJmaVpCJ3HHddUeEwKfi+yaws/vFP1w8bvmuyn4+EtSh6w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587653038; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=quRrP1uwRP5H4Ii6e0kjmuqDzDmoFmp4TyoQzCJxX5M=; b=UnvSQldqyV2TzOru5vq1X/FvXJJWmY8Eor/i4ZeFrGDDiDfBxeUHZnNyu005f/DPrKYYvARutbXr4+9V6w3e/qd69tBu/J2E754FUEdwqhKG6dk+KLT41KxONI7KQt/X1z60eIq0cme1c3J9O8KgDufG/2IARIvLWS+75uAt8ss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1587653038548159.05689363089982; Thu, 23 Apr 2020 07:43:58 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRd4d-0008Dm-6q; Thu, 23 Apr 2020 14:43:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jRd4b-0008Dh-W7 for xen-devel@lists.xenproject.org; Thu, 23 Apr 2020 14:43:30 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id cbab5a10-8570-11ea-938c-12813bfff9fa; Thu, 23 Apr 2020 14:43:29 +0000 (UTC) X-Inumbo-ID: cbab5a10-8570-11ea-938c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1587653009; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=KT99uiiLXXxW7b5WZsHxQ+NKDnuJktuqGQH/Vslb418=; b=F40VKq7Kpji2ig0R2IwHEA0gsdj1kA3T1s3DESBEu+UA1mAy6X5pSBvH etQ6bXjGXXQ3Bww0qzlm/QXkLAAFI5B3RR3r8tO+i2IX/YC5ortgMqlt8 D2v3irayQi4pvsuavFYdS1lIa+A4opNmb6xcND4ELgNJM7RjBYL/Br5UF 4=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: OolVIUDptq52i7xalbS+OChH4n9xumSf2OwlCbjh+a5/2jt51Jt3Vhz2izdflP0hqByt9pmkEV 2q3Lrk1iCc08qyElGLk796LvmPsXMMx324WSu36hMV6BK94ayBsZ58kECyauXsYPaPpQYV/11c y9plY3vZt7KgV/NPapjupaKAnGUKxxhnz/UwAWudvPD8F6oW19JMf3vpE9ObO3+FFhQgzWl5UI XMm3dN1CxkaEChjf/3Ed1rx7ut/tX9NxPbmBgKLFwl5n3JZCAHXHBJYxFztsrIMai9rdnSByyU N4o= X-SBRS: 2.7 X-MesageID: 16119446 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,307,1583211600"; d="scan'208";a="16119446" From: Roger Pau Monne To: Subject: [PATCH OSSTEST] examine/cpu: fix fetching number of threads Date: Thu, 23 Apr 2020 16:43:03 +0200 Message-ID: <20200423144303.55251-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: ian.jackson@eu.citrix.com, Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The way to fetch the number of threads from the output of xl info is wrong, as the result of =3D~ is either true or false, but will never be a numeric value. Fix the regex to have a capture group in order to fetch the number of threads, and store the capture in the threads variable. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Ian Jackson --- ts-examine-cpu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts-examine-cpu b/ts-examine-cpu index 81cf7544..fbf01dfb 100755 --- a/ts-examine-cpu +++ b/ts-examine-cpu @@ -26,7 +26,8 @@ our ($whhost) =3D @ARGV; $whhost ||=3D 'host'; our $ho=3D selecthost($whhost); our $info =3D target_cmd_output_root($ho, 'xl info', 10); -our $threads =3D $info =3D~ /^threads_per_core\s*:\s.*/m; +$info =3D~ /^threads_per_core\s*:\s(.*)$/m or die "missing or malformed in= fo"; +our $threads =3D $1; =20 logm("$ho->{Ident} threads per core: $threads"); hostflag_putative_record($ho, "hw-smt", $threads > 1); --=20 2.26.0