From patchwork Tue Oct 17 18:45:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rodriguez Bahena, Victor" X-Patchwork-Id: 827231 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-85960-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.b="jiytq+PE"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yGkgW3dllz9s7g for ; Wed, 18 Oct 2017 05:46:47 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=AGCrLKtpp/DLeWl2ZzvFLtGDhPom0ElSGRFncPswgH/HxB8TRAqQO xcRjET4BF7ggM8FET+EEiPHCxkxpNI9GN5CT+GSE+lpIsSfk51Eex+46N5m6qdR/ wcJ/vnfMgdSfccedP8pJ6ZinOvH4KJMhB29DGRbXZvhG/cDzvTMZis= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=IEGXWlxCnrEMnRmOxP2+AkzfwVI=; b=jiytq+PELYJ36YPNHWYW7oVT6y5X XKW3/uQDOV/8C8r5iha97A273gE02aEqRjMpm+PdYqaKQgSplkKc15Ple83Hc8tc 0l91yc0uH+Ac0qhHTr+FjdQuJAiDPFo53twzBZpnxVSAGWXVUp1XM3ZG/n1LkRiN ySXBC3dA1q4GBmw= Received: (qmail 3219 invoked by alias); 17 Oct 2017 18:46:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 3209 invoked by uid 89); 17 Oct 2017 18:46:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=Convenience, x X-HELO: mga11.intel.com X-ExtLoop1: 1 From: Victor Rodriguez To: libc-alpha@sourceware.org Cc: Victor Rodriguez Subject: [RFC PATCH] Group benchtests in math/pthread/string Date: Tue, 17 Oct 2017 18:45:24 +0000 Message-Id: <20171017184524.8181-1-victor.rodriguez.bahena@intel.com> This patch try to cluster the benchmarks tests in bench-math/bench-pthread/bench-string . These new rules help users to just run the benchmarks acording to the glibc area they are measuring. Signed-off-by: Victor Rodriguez --- Makefile.in | 2 +- benchtests/Makefile | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 3fe9e73..f9d55ac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -12,7 +12,7 @@ install: LC_ALL=C; export LC_ALL; \ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ -bench bench-clean bench-build: +bench bench-clean bench-build bench-math bench-pthread bench-string: $(MAKE) -C $(srcdir)/benchtests $(PARALLELMFLAGS) objdir=`pwd` $@ # Convenience target to rebuild ULPs for all math tests. diff --git a/benchtests/Makefile b/benchtests/Makefile index 37788e8..a7ec04e 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -96,6 +96,9 @@ $(objpfx)bench-malloc-thread: $(shared-thread-library) include ../Rules binaries-bench := $(addprefix $(objpfx)bench-,$(bench)) +binaries-bench-math := $(addprefix $(objpfx)bench-,$(bench-math)) +binaries-bench-pthread := $(addprefix $(objpfx)bench-,$(bench-pthread)) +binaries-bench-string := $(addprefix $(objpfx)bench-,$(bench-string)) binaries-benchset := $(addprefix $(objpfx)bench-,$(benchset)) binaries-bench-malloc := $(addprefix $(objpfx)bench-,$(bench-malloc)) @@ -147,6 +150,9 @@ bench-clean: # Define the bench target only if the target has a usable python installation. ifdef PYTHON bench: bench-build bench-set bench-func bench-malloc +bench-pthread: bench-func-pthread +bench-math: bench-func-math +bench-string: bench-func-string else bench: @echo "The bench target needs python to run." @@ -201,6 +207,69 @@ bench-func: $(binaries-bench) $(PYTHON) scripts/validate_benchout.py $(objpfx)bench.out \ scripts/benchout.schema.json +bench-func-math: $(binaries-bench-math) + { timing_type=$$($(timing-type)); \ + 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); \ + done; \ + echo; \ + echo " }"; \ + echo "}"; } > $(objpfx)bench.out-tmp; \ + if [ -f $(objpfx)bench.out ]; then \ + mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \ + fi; \ + mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out + $(PYTHON) scripts/validate_benchout.py $(objpfx)bench.out \ + scripts/benchout.schema.json + +bench-func-pthread: $(binaries-bench-pthread) + { timing_type=$$($(timing-type)); \ + 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); \ + done; \ + echo; \ + echo " }"; \ + echo "}"; } > $(objpfx)bench.out-tmp; \ + if [ -f $(objpfx)bench.out ]; then \ + mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \ + fi; \ + mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out + $(PYTHON) scripts/validate_benchout.py $(objpfx)bench.out \ + scripts/benchout.schema.json + +bench-func-string: $(binaries-bench-string) + { timing_type=$$($(timing-type)); \ + 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); \ + done; \ + echo; \ + echo " }"; \ + echo "}"; } > $(objpfx)bench.out-tmp; \ + if [ -f $(objpfx)bench.out ]; then \ + mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \ + fi; \ + mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out + $(PYTHON) scripts/validate_benchout.py $(objpfx)bench.out \ + scripts/benchout.schema.json + $(timing-type) $(binaries-bench) $(binaries-benchset) \ $(binaries-bench-malloc): %: %.o $(objpfx)json-lib.o \ $(link-extra-libs-tests) \