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: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-5.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,RDNS_DYNAMIC, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id B13BA1F8C6 for ; Mon, 13 Sep 2021 03:42:32 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A4944385842B for ; Mon, 13 Sep 2021 03:42:31 +0000 (GMT) Received: from cadetblue.ash.relay.mailchannels.net (cadetblue.ash.relay.mailchannels.net [23.83.222.28]) by sourceware.org (Postfix) with ESMTPS id D43A33858D35 for ; Mon, 13 Sep 2021 03:42:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D43A33858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 50181341D13; Mon, 13 Sep 2021 03:42:15 +0000 (UTC) Received: from pdx1-sub0-mail-a59.g.dreamhost.com (100-96-17-248.trex.outbound.svc.cluster.local [100.96.17.248]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id D30D9341D88; Mon, 13 Sep 2021 03:42:14 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a59.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.17.248 (trex/6.4.3); Mon, 13 Sep 2021 03:42:15 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Whistle-Absorbed: 263e8ff6459bd3bf_1631504535101_3973837967 X-MC-Loop-Signature: 1631504535101:2343340639 X-MC-Ingress-Time: 1631504535101 Received: from pdx1-sub0-mail-a59.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a59.g.dreamhost.com (Postfix) with ESMTP id 76D4C8ADD3; Sun, 12 Sep 2021 20:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=subject:to :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=4OCWzN SHMg5DGxNKOSgF/7PMfxc=; b=xeVPIWbq+lzG/4AP6RTzXZuWiUc1yKVC0lz1dB Qptqf4DKZ7Emktqpwi1BBKp7HISiUlRmAiRdlGezHAqU8rnV+Jrrny7Rxa1M2D2o LCHJ9UhFpoIm0IFc/2GxbfuJKDe0SEicqd1kxQ4PAIFeVMgnQQ92kUuzFguSzWQR WYWzs= Received: from [192.168.1.167] (unknown [1.186.224.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a59.g.dreamhost.com (Postfix) with ESMTPSA id C0C7F8ADD2; Sun, 12 Sep 2021 20:42:12 -0700 (PDT) Subject: Re: [PATCH v3 4/5] benchtests: Fix validate_benchout.py exceptions To: Naohiro Tamura , libc-alpha@sourceware.org References: <20210805074733.433430-1-naohirot@fujitsu.com> <20210805075144.433644-1-naohirot@fujitsu.com> X-DH-BACKEND: pdx1-sub0-mail-a59 From: Siddhesh Poyarekar Message-ID: Date: Mon, 13 Sep 2021 09:12:06 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210805075144.433644-1-naohirot@fujitsu.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 8/5/21 1:21 PM, Naohiro Tamura via Libc-alpha wrote: > 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 When do you get an AttributeError here? > > 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 > >