From: Siddhesh Poyarekar <siddhesh@sourceware.org>
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 [thread overview]
Message-ID: <20210418073427.1229743-1-siddhesh@sourceware.org> (raw)
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 filler, json_ctx_t *js)
}
stdev = sqrt (stdev / (RUN_COUNT - 1));
- 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);
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] / (double) iters);
+ json_attr_double (js, "max-outlier", (double) curs[RUN_COUNT + 1] / (double) iters);
json_attr_object_end (js);
@@ -509,13 +512,9 @@ do_bench_1 (const char *name, test_t func, json_ctx_t *js)
{
int rv = 0;
- json_attr_object_begin (js, name);
-
rv += do_bench_2 (name, func, 0, js);
rv += do_bench_2 (name, func, 1, js);
- json_attr_object_end (js);
-
return rv;
}
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"}
--
2.29.2
next reply other threads:[~2021-04-18 7:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-18 7:34 Siddhesh Poyarekar [this message]
2021-04-18 7:34 ` [committed 2/2] benchtests: Fix name of exp10f benchmark variant Siddhesh Poyarekar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210418073427.1229743-1-siddhesh@sourceware.org \
--to=siddhesh@sourceware.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).