From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 325D21F5AE for ; Tue, 20 Jul 2021 06:36:28 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6DCC23985806 for ; Tue, 20 Jul 2021 06:36:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DCC23985806 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626762987; 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=HSO5alqjHKdv3a0USPlZUlH56j7UmuWcJODQBfxxTM1vv6SiqJrma5Q/HSGq0uhLH gnmvOTzTxWZvRKEZt6s8yro1zpqlCqP/ONlre96EQQwJFYZCMReao1OPpehX0xXfRy u6hVlFL/5EtFbN7xnrXAYPMtvjuFg0SLM8mHu4eE= 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-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: , From: Naohiro Tamura via Libc-alpha Reply-To: Naohiro Tamura Errors-To: libc-alpha-bounces+e=80x24.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) +' -- 2.17.1