From patchwork Tue Jul 20 06:35:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naohiro Tamura X-Patchwork-Id: 44434 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B6C73985800 for ; Tue, 20 Jul 2021 06:36:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B6C73985800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626762989; bh=xq7A6Fiku7Y4glqtT2xxv+4VSXS0nQKDMa0WFXaADvo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=sw+1133rTdVvXEu8FUXVPYny4PR9BCKdIVVXIMVan8pgLcc27hS19nQO26vYZL0WF Hkx2L4kvLp7RwbbeRUjbP9VqeousMsB11xKhdaSM29ehzd0MYR0lrFZW6epvBTk7HR UdaGwNqAULuDuObrCmXtPkeEIfU78EVwmPHk2cyw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa9.hc1455-7.c3s2.iphmx.com (esa9.hc1455-7.c3s2.iphmx.com [139.138.36.223]) by sourceware.org (Postfix) with ESMTPS id 85D16385043C for ; Tue, 20 Jul 2021 06:35:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 85D16385043C IronPort-SDR: 5KPOkYJmZVV01eYiYZh/X+g+KkEZBjE7uLBZt9yfz5q3hijXuIe2bp6FMDO8tw5XiuWezIbVoc 2iJo0Af+NU4XMJq6gK8c/FET01nBcpWr4DBg4u4dpM8yBVRzN1Pnx1mdVPl8taKmlXISNuD2LG fli9ydQoPhQHBiGt+cqW0WyzqHbhnoKjLvx+evSoNACqchfboqYFBcjCm4+FMv1rEOLcLFgc1o Bud7tr+u+i/gZQEyCl9RltSxJY8mqKBfbtbvh2UuaFM4UP7dE7xlP7yRuDVdB3W8Say7xhaYdf 80R9O++oV58tmHL87aUayXHr X-IronPort-AV: E=McAfee;i="6200,9189,10050"; a="25295240" X-IronPort-AV: E=Sophos;i="5.84,254,1620658800"; d="scan'208";a="25295240" Received: from unknown (HELO yto-r4.gw.nic.fujitsu.com) ([218.44.52.220]) by esa9.hc1455-7.c3s2.iphmx.com with ESMTP; 20 Jul 2021 15:35:44 +0900 Received: from yto-m4.gw.nic.fujitsu.com (yto-nat-yto-m4.gw.nic.fujitsu.com [192.168.83.67]) by yto-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id 5909D21EC04 for ; Tue, 20 Jul 2021 15:35:44 +0900 (JST) Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by yto-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id A8B3258BEA0 for ; Tue, 20 Jul 2021 15:35:43 +0900 (JST) Received: from bionic.lxd (unknown [10.126.53.116]) by m3050.s.css.fujitsu.com (Postfix) with ESMTP id A46D9AB; Tue, 20 Jul 2021 15:35:43 +0900 (JST) To: Noah Goldstein , Wilco Dijkstra , "Lucas A. M. Magalhaes" , libc-alpha@sourceware.org Subject: [PATCH v2 3/5] benchtests: Add a script to convert benchout string JSON to CSV Date: Tue, 20 Jul 2021 06:35:40 +0000 Message-Id: <20210720063540.362366-1-naohirot@fujitsu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210713082214.307529-1-naohirot@fujitsu.com> References: <20210713082214.307529-1-naohirot@fujitsu.com> X-TM-AS-GCONF: 00 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naohiro Tamura via Libc-alpha From: Naohiro Tamura Reply-To: Naohiro Tamura Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This patch adds "benchout_string2csv.sh" script to convert benchout string JSON to CSV so that we can visualize performance data by any spreadsheet such as MS Excel and Google Sheet. Usage: benchout_string2csv.sh read benchout string JSON from standard input write CSV to standard output ex: $ cat bench-memset.out | benchout_string2csv.sh > bench-memset.csv --- benchtests/scripts/benchout_string2csv.sh | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 benchtests/scripts/benchout_string2csv.sh diff --git a/benchtests/scripts/benchout_string2csv.sh b/benchtests/scripts/benchout_string2csv.sh new file mode 100755 index 000000000000..045870fed162 --- /dev/null +++ b/benchtests/scripts/benchout_string2csv.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright (C) 2021 Free Software Foundation, Inc. +# This file is part of the GNU C Library. +# Contributed by Ulrich Drepper , 1998. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +# +# Convert benchout string JSON to CSV +# +if [[ $1 == "-h" ]] || [[ $# != 0 ]]; then + echo "Usage: ${0##*/}" + echo " read benchout string JSON from standard input" + echo " write CSV to standard output" + echo "ex:" + echo " $ cat bench-memset.out | ${0##*/} > bench-memset.csv" +exit 1 +fi + +jq -r ' + . as $root | + . as {$functions} | + $functions | to_entries | .[0].value as $func_value | + $func_value as {$_, $ifuncs, $results} | + (["timing_type", $root.timing_type] | @csv), + (["functions", ($functions | keys | .[0]), + "bench-variant", $func_value."bench-variant"] | @csv), + ($results[0] | to_entries | map([.key]) | flatten | @csv), + ($results[0] | reduce range(1; . | length) as $_ ([]; . + [""]) + + $ifuncs | @csv), + ($results[] | to_entries | map([.value]) | flatten | @csv) +'