From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cyan.elm.relay.mailchannels.net (cyan.elm.relay.mailchannels.net [23.83.212.47]) by sourceware.org (Postfix) with ESMTPS id 675C9393A426 for ; Sun, 18 Apr 2021 07:34:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 675C9393A426 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 CCE4712219E for ; Sun, 18 Apr 2021 07:34:38 +0000 (UTC) Received: from pdx1-sub0-mail-a18.g.dreamhost.com (100-96-18-71.trex.outbound.svc.cluster.local [100.96.18.71]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5002C122205 for ; Sun, 18 Apr 2021 07:34:36 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a18.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.18.71 (trex/6.1.1); Sun, 18 Apr 2021 07:34:38 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Descriptive-Reaction: 63912a3024a699b7_1618731278385_1109226025 X-MC-Loop-Signature: 1618731278384:41513819 X-MC-Ingress-Time: 1618731278384 Received: from pdx1-sub0-mail-a18.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a18.g.dreamhost.com (Postfix) with ESMTP id 0F76986EF6 for ; Sun, 18 Apr 2021 00:34:36 -0700 (PDT) Received: from rhbox.intra.reserved-bit.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a18.g.dreamhost.com (Postfix) with ESMTPSA id A95FF86EF5 for ; Sun, 18 Apr 2021 00:34:34 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a18 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [committed 1/2] benchtests: Fix pthread-locks test to produce valid json Date: Sun, 18 Apr 2021 13:04:26 +0530 Message-Id: <20210418073427.1229743-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3494.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Sun, 18 Apr 2021 07:34:51 -0000 The benchtests json allows {function {variant}} categorization of results whereas the pthread-locks tests had {function {variant {subvariant}}}, which broke validation. Fix that by serializing the subvariants as variant-subvariant. Also update the schema to recognize the new benchmark attributes after fixing the naming conventions. --- benchtests/bench-pthread-locks.c | 15 +++++++-------- benchtests/scripts/benchout.schema.json | 4 ++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/benchtests/bench-pthread-locks.c b/benchtests/bench-pthread-= locks.c index 318c92bd8e..5274246a4b 100644 --- a/benchtests/bench-pthread-locks.c +++ b/benchtests/bench-pthread-locks.c @@ -487,17 +487,20 @@ do_bench_2 (const char *name, test_t func, int fill= er, json_ctx_t *js) } stdev =3D sqrt (stdev / (RUN_COUNT - 1)); =20 - json_attr_object_begin (js, filler ? "filler" : "empty"); + char buf[128]; + snprintf (buf, sizeof buf, "%s-%s", name, filler ? "filler" : "empty")= ; + + json_attr_object_begin (js, buf); =20 json_attr_double (js, "duration", (double) cur); json_attr_double (js, "iterations", (double) iters); - json_attr_double (js, "wall_sec", (double) td); + json_attr_double (js, "wall-sec", (double) td); json_attr_double (js, "mean", mean); json_attr_double (js, "stdev", stdev); - json_attr_double (js, "min_outlier", (double) curs[0] / (double) iters= ); + json_attr_double (js, "min-outlier", (double) curs[0] / (double) iters= ); json_attr_double (js, "min", (double) curs[1] / (double) iters); json_attr_double (js, "max", (double) curs[RUN_COUNT] / (double) iters= ); - json_attr_double (js, "max_outlier", (double) curs[RUN_COUNT + 1] / (d= ouble) iters); + json_attr_double (js, "max-outlier", (double) curs[RUN_COUNT + 1] / (d= ouble) iters); =20 json_attr_object_end (js); =20 @@ -509,13 +512,9 @@ do_bench_1 (const char *name, test_t func, json_ctx_= t *js) { int rv =3D 0; =20 - json_attr_object_begin (js, name); - rv +=3D do_bench_2 (name, func, 0, js); rv +=3D do_bench_2 (name, func, 1, js); =20 - json_attr_object_end (js); - return rv; } =20 diff --git a/benchtests/scripts/benchout.schema.json b/benchtests/scripts= /benchout.schema.json index 8cfd606497..5f098e91c9 100644 --- a/benchtests/scripts/benchout.schema.json +++ b/benchtests/scripts/benchout.schema.json @@ -27,6 +27,10 @@ "min-throughput": {"type": "number"}, "max-throughput": {"type": "number"}, "reciprocal-throughput": {"type": "number"}, + "min-outlier": {"type": "number"}, + "max-outlier": {"type": "number"}, + "wall-sec": {"type": "number"}, + "stdev": {"type": "number"}, "timings": { "type": "array", "items": {"type": "number"} --=20 2.29.2