From patchwork Wed Nov 18 21:05:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1402550 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CbwMx36vBz9sTR for ; Thu, 19 Nov 2020 08:06:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 90FAA228BD; Wed, 18 Nov 2020 21:06:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rciZ8r8hKp9O; Wed, 18 Nov 2020 21:06:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 1A91D204CE; Wed, 18 Nov 2020 21:06:15 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D9A79C0891; Wed, 18 Nov 2020 21:06:14 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 05EE5C07FF for ; Wed, 18 Nov 2020 21:06:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5B46C228A7 for ; Wed, 18 Nov 2020 21:06:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oT7z9cgVUbtm for ; Wed, 18 Nov 2020 21:06:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by silver.osuosl.org (Postfix) with ESMTPS id 36AF1204D3 for ; Wed, 18 Nov 2020 21:06:09 +0000 (UTC) Received: from im-t490s.redhat.com (ip-78-45-89-65.net.upcbroadband.cz [78.45.89.65]) (Authenticated sender: i.maximets@ovn.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 6D5C6240005; Wed, 18 Nov 2020 21:06:05 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Wed, 18 Nov 2020 22:05:59 +0100 Message-Id: <20201118210559.1344917-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Cc: Ilya Maximets Subject: [ovs-dev] [PATCH] perf-counter: Split numbers in the output. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" While trying to benchmark big functions, values could be longer than 12 digits. In this case all of them printed without spaces. It's hard ot read. Fixes: 619c3a42dc1e ("lib: add a hardware performance counter access library") Signed-off-by: Ilya Maximets Acked-by: Greg Rose --- lib/perf-counter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/perf-counter.c b/lib/perf-counter.c index 402fabe17..e4eca58d0 100644 --- a/lib/perf-counter.c +++ b/lib/perf-counter.c @@ -111,7 +111,7 @@ perf_counter_to_ds(struct ds *ds, struct perf_counter *pfc) ratio = 0.0; } - ds_put_format(ds, "%-40s%12"PRIu64"%12"PRIu64"%12.1f\n", + ds_put_format(ds, "%-40s %12"PRIu64" %12"PRIu64" %12.1f\n", pfc->name, pfc->n_events, pfc->total_count, ratio); }