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.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,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 1961A1F8C6 for ; Mon, 26 Jul 2021 08:36:09 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 709583888C62 for ; Mon, 26 Jul 2021 08:36:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 709583888C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627288567; bh=UHUEz0YjaT56qKF2o3T8wznjxGc8EjNxUZxTlMik7BU=; 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=RBH/s8dhMVLliTPbaDds5dvSnuUAaweO60QxnoMGkt/wN9/0PFCieuzrBp0WxIzLm +oy+qM+aNevrL+fxymT2SprxjzuNW0FKXjOEUjZEpgEYUEc0lHS8TOzLiAXYN66md3 bWMl+s7NhBQDO8QwGmt+cy3wOZthLmKNR0Nqm8RQ= Received: from esa12.hc1455-7.c3s2.iphmx.com (esa12.hc1455-7.c3s2.iphmx.com [139.138.37.100]) by sourceware.org (Postfix) with ESMTPS id 80FCE3886C47 for ; Mon, 26 Jul 2021 08:35:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 80FCE3886C47 IronPort-SDR: 5XGz3iRPLcpEm8tes7eMc4v4qXzFSmSF8SpJYg/lVIpnHvgHvrurdkaaLUGHmCLJha0YXlUEVF gqiBaOjywljHkbVRM9n3KqVje2SDlZvTDjClS4OJVet5Xi5KxM7BOwy3yrNKkpENHaIWj+qrGr 2aLkAiF29MnczcHVmAwn4U9rmmNMK32p3OgKBEeRFF3KnNQkGKSvTrMCpHwCjdriw/SLM5DQFU RWkzVXp5BwLyRttOGXpay3aiR4mS/+3hLLiumcljAiuhlP7MFBl5SqngmtpQ/HsF4+eTWt6/NR A+A0E4QZEVmunGvG6JQDPk85 X-IronPort-AV: E=McAfee;i="6200,9189,10056"; a="17780718" X-IronPort-AV: E=Sophos;i="5.84,270,1620658800"; d="scan'208";a="17780718" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa12.hc1455-7.c3s2.iphmx.com with ESMTP; 26 Jul 2021 17:35:20 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 3A8266C9A6 for ; Mon, 26 Jul 2021 17:35:20 +0900 (JST) Received: from m3051.s.css.fujitsu.com (m3051.s.css.fujitsu.com [10.134.21.209]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 6F5C914271 for ; Mon, 26 Jul 2021 17:35:19 +0900 (JST) Received: from bionic.lxd (unknown [10.126.53.116]) by m3051.s.css.fujitsu.com (Postfix) with ESMTP id 532439E; Mon, 26 Jul 2021 17:35:19 +0900 (JST) To: libc-alpha@sourceware.org Subject: [PATCH] benchtests: Add a script to merge two benchout string files Date: Mon, 26 Jul 2021 08:35:16 +0000 Message-Id: <20210726083516.385629-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 a script to merge two benchout string files into one in terms of an ifunc in order to create a comparison graph. Usage: merge_strings4graph.sh ifunc_name graph_tag1 graph_tag2 read two benchout string files from standard input write merged benchout string file to standard output ex: $ cat master/bench-memset.out patch/bench-memset.out | \ > merge_strings4graph.sh __memset_generic master patch | \ > plot_strings.py -l -p thru -v - --- benchtests/scripts/merge_strings4graph.sh | 57 +++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 benchtests/scripts/merge_strings4graph.sh diff --git a/benchtests/scripts/merge_strings4graph.sh b/benchtests/scripts/merge_strings4graph.sh new file mode 100755 index 000000000000..ac38b6327f01 --- /dev/null +++ b/benchtests/scripts/merge_strings4graph.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# Copyright (C) 2021 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# 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 +# . + +# +# Merge two benchout string files into one in terms of an ifunc +# in order to create a comparison graph +# +if [[ $1 == "-h" ]] || [[ $# != 3 ]]; then + echo "Usage: ${0##*/} ifunc_name graph_tag1 graph_tag2" + echo " read two benchout string files from standard input" + echo " write merged benchout string file to standard output" + echo "ex:" + echo " $ cat bench-memset-first.out bench-memset-second.out | \\ + > ${0##*/} __memset_generic graph_tag1 graph_tag2 | \\ + > plot_strings.py -l -p thru -v -" +exit 1 +fi + +jq -rs --arg ifunc_name $1 --arg graph_tag1 $2 --arg graph_tag2 $3 ' +. as $root | +.[0] as $first | +$first.functions.memset.ifuncs | + length as $ifuncs_len | + index($ifunc_name) as $ifunc_index | +$root | + del(.[].functions.memset.results[].timings[$ifunc_index+1:$ifuncs_len]) | + del(.[].functions.memset.results[].timings[0:$ifunc_index]) | + [.[].functions.memset.results] | transpose as $pair | +$pair | + reduce range(0; $pair|length) as $i ( + []; . + [$pair[$i][0].timings+$pair[$i][1].timings] + ) | . as $newtimings | + reduce range(0; $pair|length) as $j ( + []; . + [{"length":$first.functions.memset.results[$j].length, + "timings":$newtimings[$j]}] + ) | . as $newresults | +$first | + .functions.memset."bench-variant"+="-"+$graph_tag1+"-"+$graph_tag2 | + .functions.memset.ifuncs=[$ifunc_name+"-"+$graph_tag1,$ifunc_name+"-"+$graph_tag2] | + .functions.memset.results=$newresults +' + -- 2.17.1