From nobody Mon Feb 9 12:09:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608049567; cv=none; d=zohomail.com; s=zohoarc; b=OOp40W2AO7fVAyVmjbYjbdHx/hNxqpJ4XTeaQECHMnKN2MVGEAIwr/Z3RRSmHlBxcnxSHqOUA/OAseToIP5X8AeeZwrVYd8Ab/7vLWYHBzzS7/O+xqkweII9qu4Q+xWChxmdY15HuKFbR0oheFCpJ8Q3cOq3iwJOVPmIsfc1nc8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608049567; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sj+VUFfDu5K7sZAMKFBzACf7YN9/s5ZHMOxBcIYR/Jo=; b=akdczoPkDiguwQRyscGHlbWw/ie3j2crL3cA2jymuP547TGeBmCk+bgDqxbr9HeambeqYF5P9w8bV/d8m/yIvDNUBA6x0pxiwFtm3P6F7qJPH9vTrgWVJ0bbvnwoQt8FnxdW27+u/OHNjOBApGgY4L3s4e80Dqejwc4GlGm8+dY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1608049567639187.46492512273392; Tue, 15 Dec 2020 08:26:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-36-aLgz5DTVMj6GAmjuFHcmwg-1; Tue, 15 Dec 2020 11:26:02 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48240107AD32; Tue, 15 Dec 2020 16:25:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C7FE60C15; Tue, 15 Dec 2020 16:25:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D416E4EE0B; Tue, 15 Dec 2020 16:25:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BFGPcY8025800 for ; Tue, 15 Dec 2020 11:25:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id D947E5D9E3; Tue, 15 Dec 2020 16:25:38 +0000 (UTC) Received: from work.redhat.com (ovpn-114-20.ams2.redhat.com [10.36.114.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E1A35D9D7; Tue, 15 Dec 2020 16:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608049564; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sj+VUFfDu5K7sZAMKFBzACf7YN9/s5ZHMOxBcIYR/Jo=; b=cSkdWfve8Cy5Xn6D9WmfumWeA6MRefMOOjXPWlQtk9h8CRMspffO302DXtZ1aswe9zzseD EmrP+kDvPVGMequDvpLlHtorCxvROrliSWMMPOn4UMfZzVMgpuOTFxzpwHfenJREXteU4w XHmnvvUact7pHGRFtxrGMdj4MKGyVGU= X-MC-Unique: aLgz5DTVMj6GAmjuFHcmwg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 19/29] cpu-parse: Move file name generation to new script Date: Tue, 15 Dec 2020 17:25:05 +0100 Message-Id: <20201215162515.53742-20-twiederh@redhat.com> In-Reply-To: <20201215162515.53742-1-twiederh@redhat.com> References: <20201215162515.53742-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-gather.py | 18 ++++++++++++++++++ tests/cputestdata/cpu-parse.sh | 13 ------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather= .py index 0b1019456c..1a15cc1ff0 100755 --- a/tests/cputestdata/cpu-gather.py +++ b/tests/cputestdata/cpu-gather.py @@ -4,6 +4,7 @@ import argparse import fcntl import json import os +import re import struct import subprocess import sys @@ -192,11 +193,28 @@ def gather(args): return result =20 =20 +def parse_filename(data): + filename =3D data["name"].strip() + filename =3D re.sub("[ -]+ +", " ", filename) + filename =3D re.sub("\\(([Rr]|[Tt][Mm])\\)", "", filename) + filename =3D re.sub(".*(Intel|AMD) ", "", filename) + filename =3D re.sub(" (Duo|Quad|II X[0-9]+)", " ", filename) + filename =3D re.sub(" (CPU|Processor)", "", filename) + filename =3D re.sub(" @.*", "", filename) + filename =3D re.sub(" APU .*", "", filename) + filename =3D re.sub(" SE$", "", filename) + filename =3D re.sub(" ", "-", filename) + return "x86_64-cpuid-{}".format(filename) + + def parse(args): data =3D json.load(sys.stdin) =20 + filename =3D parse_filename(data) + os.environ["CPU_GATHER_PY"] =3D "true" os.environ["model"] =3D data["name"] + os.environ["fname"] =3D filename output =3D subprocess.check_output( "./cpu-parse.sh", input=3Doutput_to_text(data), diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh index 5b8e57e427..2a41897538 100755 --- a/tests/cputestdata/cpu-parse.sh +++ b/tests/cputestdata/cpu-parse.sh @@ -7,19 +7,6 @@ fi =20 data=3D`cat` =20 -fname=3D`sed -e 's/^ *//; - s/ *$//; - s/[ -]\+ \+/ /g; - s/(\([Rr]\|[Tt][Mm]\))//g; - s/.*\(Intel\|AMD\) //; - s/ \(Duo\|Quad\|II X[0-9]\+\) / /; - s/ \(CPU\|Processor\)\>//; - s/ @.*//; - s/ APU .*//; - s/ SE$//; - s/ /-/g' <<<"$model"` -fname=3D"x86_64-cpuid-$fname" - xml() { hex=3D'\(0x[0-9a-f]\+\)' --=20 2.26.2