From patchwork Tue Jul 20 06:37:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naohiro Tamura X-Patchwork-Id: 1507403 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=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=DW0M3mJR; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 ozlabs.org (Postfix) with ESMTPS id 4GTTYF1w8Jz9sWc for ; Tue, 20 Jul 2021 16:37:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA720398580F for ; Tue, 20 Jul 2021 06:37:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA720398580F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626763070; bh=vtnme6zsFx6MVE7z98T+KbfjrtZ0HVb6rW4DiikKyhs=; 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=DW0M3mJRT3eEk0+x4G7i9OazHGW0PZ93kL4vhbVy6Z5dSZ9qXN0a5Yc8gCB6qG5Dm gMz6yCNDwWORuwu4B2gM/tqznh3gDbVLYdZhY2/zT+AMVr4i08GxocPrZMFjUPkN3j RpIL7yhD4QcqQdcOFtLl1kRslRXy72cc6ciOP4og= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 972133985800 for ; Tue, 20 Jul 2021 06:37:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 972133985800 IronPort-SDR: HjPzBjEi8m3g4hOBmanNYRsaRSVBAFb2zta2LY3j3v0Gczq8f5vd1/hn8JILVx/cJTxDIVDNb6 c/Hadr9hwFYt4hHiUZGyrbkAd+tNNq6Q4k3VBBcZqGF3PriQwdT/8M0JCGHLhuAD034q4gT+Wj HQ/pX5vnfxkQVlJbDO6LZkCC7MyS/VII0S8YwA10S/u/gP5kKUlG5hc0CuE0gIKberfbDpU17Y 1cDAAvsgzKGjXRQvuAvgMqYO/i/tS6J/H0Zown9v6mGKIIX5DHaQ/eZX/+vLh0XS04lm8vy56C gDgih36HEnad86HwzsyJdWOD X-IronPort-AV: E=McAfee;i="6200,9189,10050"; a="17244140" X-IronPort-AV: E=Sophos;i="5.84,254,1620658800"; d="scan'208";a="17244140" Received: from unknown (HELO yto-r2.gw.nic.fujitsu.com) ([218.44.52.218]) by esa12.hc1455-7.c3s2.iphmx.com with ESMTP; 20 Jul 2021 15:37:06 +0900 Received: from yto-m4.gw.nic.fujitsu.com (yto-nat-yto-m4.gw.nic.fujitsu.com [192.168.83.67]) by yto-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id 3AC14A80C2 for ; Tue, 20 Jul 2021 15:37:06 +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 879CA58BEAA for ; Tue, 20 Jul 2021 15:37:05 +0900 (JST) Received: from bionic.lxd (unknown [10.126.53.116]) by m3050.s.css.fujitsu.com (Postfix) with ESMTP id 844E3AB; Tue, 20 Jul 2021 15:37:05 +0900 (JST) To: Noah Goldstein , Wilco Dijkstra , "Lucas A. M. Magalhaes" , libc-alpha@sourceware.org Subject: [PATCH v2 5/5] benchtests: Fix validate_benchout.py exceptions Date: Tue, 20 Jul 2021 06:37:03 +0000 Message-Id: <20210720063703.362472-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=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" This patch fixed validate_benchout.py two exceptions, AttributeError if benchout_strings.schema.json is specified and json.decoder.JSONDecodeError if benchout is not JSON. --- benchtests/scripts/import_bench.py | 5 ++++- benchtests/scripts/validate_benchout.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/benchtests/scripts/import_bench.py b/benchtests/scripts/import_bench.py index a799b4e1b7dc..e3337ca5d638 100644 --- a/benchtests/scripts/import_bench.py +++ b/benchtests/scripts/import_bench.py @@ -104,7 +104,10 @@ def do_for_all_timings(bench, callback): """ for func in bench['functions'].keys(): for k in bench['functions'][func].keys(): - if 'timings' not in bench['functions'][func][k].keys(): + try: + if 'timings' not in bench['functions'][func][k].keys(): + continue + except AttributeError: continue callback(bench, func, k) diff --git a/benchtests/scripts/validate_benchout.py b/benchtests/scripts/validate_benchout.py index 47df33ed0252..00d5fa0ee5eb 100755 --- a/benchtests/scripts/validate_benchout.py +++ b/benchtests/scripts/validate_benchout.py @@ -73,11 +73,15 @@ def main(args): except bench.validator.ValidationError as e: return print_and_exit("Invalid benchmark output: %s" % e.message, - os.EX_DATAERR) + os.EX_DATAERR) except bench.validator.SchemaError as e: return print_and_exit("Invalid schema: %s" % e.message, os.EX_DATAERR) + except json.decoder.JSONDecodeError as e: + return print_and_exit("Benchmark output in %s is not JSON." % args[0], + os.EX_DATAERR) + print("Benchmark output in %s is valid." % args[0]) return os.EX_OK