public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/nsz/bug23293] benchtests: Add UNSUPPORTED benchmark status
Date: Wed,  4 May 2022 06:02:23 +0000 (GMT)	[thread overview]
Message-ID: <20220504060223.8E84F3858016@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=944afe6d9589c6000327898bcd28c0ee8cf63669

commit 944afe6d9589c6000327898bcd28c0ee8cf63669
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Fri Apr 29 11:06:00 2022 +0530

    benchtests: Add UNSUPPORTED benchmark status
    
    The libmvec benchmarks print a message indicating that a certain CPU
    feature is unsupported and exit prematurelyi, which breaks the JSON in
    bench.out.
    
    Handle this more elegantly in the bench makefile target by adding
    support for an UNSUPPORTED exit status (77) so that bench.out continues
    to have output for valid tests.
    
    Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 benchtests/Makefile                         | 23 ++++++++++++++++++-----
 sysdeps/x86_64/fpu/bench-libmvec-skeleton.c | 12 ++++++------
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/benchtests/Makefile b/benchtests/Makefile
index b477042e6c..7943d1c58a 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -1,4 +1,5 @@
 # Copyright (C) 2013-2022 Free Software Foundation, Inc.
+# Copyright The GNU Toolchain Authors.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -417,11 +418,23 @@ bench-func: $(binaries-bench)
 	  echo "{\"timing_type\": \"$${timing_type}\","; \
 	  echo " \"functions\": {"; \
 	  for run in $^; do \
-	    if ! [ "x$${run}" = "x$<" ]; then \
-	      echo ","; \
-	    fi; \
-	    echo "Running $${run}" >&2; \
-	    $(run-bench) $(DETAILED_OPT); \
+	    op=$$($(run-bench) $(DETAILED_OPT)); \
+	    ret=$$?; \
+	    case "$${ret}" in \
+	      77) \
+	      echo "UNSUPPORTED $${run}: $${op}" >&2; \
+		;; \
+	      0) \
+		echo "Running $${run}" >&2; \
+		if [ "$${run}" != "$<" ]; then \
+		  echo ","; \
+		fi; \
+		echo "$${op}"; \
+		;; \
+	      *) \
+		echo "FAILED $${run}" >&2; \
+		;; \
+	    esac; \
 	  done; \
 	  echo; \
 	  echo " }"; \
diff --git a/sysdeps/x86_64/fpu/bench-libmvec-skeleton.c b/sysdeps/x86_64/fpu/bench-libmvec-skeleton.c
index 8954abe8b8..e28249df91 100644
--- a/sysdeps/x86_64/fpu/bench-libmvec-skeleton.c
+++ b/sysdeps/x86_64/fpu/bench-libmvec-skeleton.c
@@ -40,20 +40,20 @@ main (int argc, char **argv)
 #if defined REQUIRE_AVX
   if (!CPU_FEATURE_ACTIVE (AVX))
     {
-      printf ("AVX not supported.\n");
-      return 0;
+      printf ("AVX not supported.");
+      return 77;
     }
 #elif defined REQUIRE_AVX2
   if (!CPU_FEATURE_ACTIVE (AVX2))
     {
-      printf ("AVX2 not supported.\n");
-      return 0;
+      printf ("AVX2 not supported.");
+      return 77;
     }
 #elif defined REQUIRE_AVX512F
   if (!CPU_FEATURE_ACTIVE (AVX512F))
     {
-      printf ("AVX512F not supported.\n");
-      return 0;
+      printf ("AVX512F not supported.");
+      return 77;
     }
 #endif


                 reply	other threads:[~2022-05-04  6:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220504060223.8E84F3858016@sourceware.org \
    --to=nsz@sourceware.org \
    --cc=glibc-cvs@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).