From nobody Tue Feb 10 03:45:16 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=1608050792; cv=none; d=zohomail.com; s=zohoarc; b=Z8qe6iw7zdVj7gsSQiI6ynGdmTC6aZklJoiZ443nBcK4om9GMnlh0Ik+AIjo6QfqiLJUTtLp1iFFWJTBHBLejX9lqIAVQT6qioIh1p0mlo8ZSK51mLb2iyUG+jlKeWrYt5+Dy+7wMpESS1MGKKHTennpuqHKpu7fMzEkwwB7Uig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608050792; 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=V1OkfndGO0eEmmKNJNsaRf756ReI+DQSd5J79EH6wuQ=; b=bAZKdclPjmkb8d/TISgYw9832ZylrN4F6TWyBz4GeT2KXV02s5SJ5lriLnh6jlAemrdSV0Y9Juewyc+svmYBCHYBfHDb6asYDEc+r1fd1abD0l4XkvTPHb0k+NHtxYrlMkCRVifA/jk+GHK7rOk9NLVNeR1BTGaJVFQ1wX7z0f4= 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 160805079242469.17988890052993; Tue, 15 Dec 2020 08:46:32 -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-322-LOgWzaKHMxKWRX9lWzpJ8w-1; Tue, 15 Dec 2020 11:32:40 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D7E88921C00; Tue, 15 Dec 2020 16:31:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 552C270497; Tue, 15 Dec 2020 16:31:54 +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 1810F1809CAA; Tue, 15 Dec 2020 16:31:54 +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 0BFGPatP025772 for ; Tue, 15 Dec 2020 11:25:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8EA005D9E3; Tue, 15 Dec 2020 16:25:36 +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 C14455D9D7; Tue, 15 Dec 2020 16:25:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608049962; 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=V1OkfndGO0eEmmKNJNsaRf756ReI+DQSd5J79EH6wuQ=; b=fiJUxDodevFwxajc+Jz+NkaqMzcqyxUkAnjy+ogGQu+Ql85Bo1R2NfD//zK3oBEhCSw90+ plP8prMOqqm7EG+RYJZVg65ZTOdI1r3zOHJALZCQ0xKo1lumTaPMiR1hMEMefE2z5wdLVl 2N/HWdjmjKhZWyBROe6NpUEEJr7cAso= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608050789; 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=V1OkfndGO0eEmmKNJNsaRf756ReI+DQSd5J79EH6wuQ=; b=arahpL0/e1HMSw2pLm9/cjEMOGm6CtwZ2fT7VXPr/NGp/2rZCJH5py/bQlnt474pfmOg8S COFEgVMH8UTSCGnX1Exaw9aUmJmCATWUdsIuPsD0h4+ddHu+Q7J9VqA9vkxD4+eTWs2eGr jFktZ5lAMr17zXByExliYYzDuiW3gSY= X-MC-Unique: LOgWzaKHMxKWRX9lWzpJ8w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 17/29] cpu-gather: Transport data as json Date: Tue, 15 Dec 2020 17:25:03 +0100 Message-Id: <20201215162515.53742-18-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.11 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) (identity @redhat.com) Content-Type: text/plain; charset="utf-8" More reliable, easier to parse, easier to edit. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-gather.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather= .py index 83f175d342..7c51a47353 100755 --- a/tests/cputestdata/cpu-gather.py +++ b/tests/cputestdata/cpu-gather.py @@ -193,9 +193,12 @@ def gather(args): =20 =20 def parse(args): + data =3D json.load(sys.stdin) + os.environ["CPU_GATHER_PY"] =3D "true" output =3D subprocess.check_output( "./cpu-parse.sh", + input=3Doutput_to_text(data), stderr=3Dsubprocess.STDOUT, universal_newlines=3DTrue) print(output) @@ -267,7 +270,7 @@ def main(): =20 if args.gather: data =3D gather(args) - print(output_to_text(data)) + json.dump(data, sys.stdout, indent=3D2) else: parse(args) =20 --=20 2.26.2