From patchwork Wed Apr 20 07:51:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 612526 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3qqYxP467Tz9t5Y for ; Wed, 20 Apr 2016 17:51:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=vc6xD160; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=cNR4gdQpxiXjmfrpNA/SAxLWPrnef oXy0QJ8RDSDYT8VXz6i1pWdNTbsSaZ1sI1MAq6WG68I9X2Z1KNug72yQdiUO4AZX 189NiQkXvaSAip9ttjfn8Yhb74daMB+jHS9nQTs/8P+A9QPpOwqAh1imdfXlSaeQ LFSECDSqMtr2Yk= 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:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=14Jovnm1/9jhUSApPXS0yVliD3k=; b=vc6 xD16001OAy9Da+ebmdd4g459l5G3qhkwRF2jCPP8jfRdQXt+MkmTuF1AbVUBaVKa k0DKo47fson/7pzeaI5WJn98//t5UKk/guLXNBj23mmW83CCYxN7Aj3sRCNm1GiC ImHIuQ5J8r2Gq0fdfQXhLffI4qQyxs9HudxQ+DXM= Received: (qmail 36884 invoked by alias); 20 Apr 2016 07:51:48 -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 36862 invoked by uid 89); 20 Apr 2016 07:51:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=13110, 131, 10, no, o X-HELO: mx-out01.mykolab.com X-Spam-Score: -2.9 Date: Wed, 20 Apr 2016 13:21:23 +0530 From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [COMMITTED] benchtests: Support for cross-building benchmarks Message-ID: <20160420075118.GA9386@devel.intra.reserved-bit.com> MIME-Version: 1.0 Content-Disposition: inline This patch adds full support for cross-building benchmarks. Some benchmarks like those that need locales to be generated cannot be built and are hence skipped for cross builds. Tested by cross building for aarch64 on x86_64 and then running the generated benchmark on aarch64. * benchtests/Makefile (wcsmbs-benchset): Include only for native builds and runs. (LOCALES): Likewise. (bench-build): Build timing-type here instead of the bench target. Generate locale only for native builds. * benchtests/README: Add note for cross-building. --- ChangeLog | 7 +++++++ benchtests/Makefile | 23 +++++++++++++++++++---- benchtests/README | 4 +++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f26f8f8..ded1093 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2016-04-20 Siddhesh Poyarekar + * benchtests/Makefile (wcsmbs-benchset): Include only for + native builds and runs. + (LOCALES): Likewise. + (bench-build): Build timing-type here instead of the bench + target. Generate locale only for native builds. + * benchtests/README: Add note for cross-building. + * benchtests/Makefile (bench-clean): Clean up extra-objs. * benchtests/README: Update README to include instructions on diff --git a/benchtests/Makefile b/benchtests/Makefile index 779eb39..144b32e 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -39,11 +39,19 @@ string-benchset := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \ strncasecmp strncat strncmp strncpy strnlen strpbrk strrchr \ strspn strstr strcpy_chk stpcpy_chk memrchr strsep strtok \ strcoll memcpy-large memmove-large memset-large + +# Build and run locale-dependent benchmarks only if we're building natively. +ifeq (no,$(cross-compiling)) wcsmbs-benchset := wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat \ wcscmp wcsncmp wcschr wcschrnul wcsrchr wcsspn wcspbrk wcscspn \ wmemchr wmemset wmemcmp +else +wcsmbs-benchset := +endif + string-benchset-all := $(string-benchset) ${wcsmbs-benchset} +ifeq (no,$(cross-compiling)) # We have to generate locales LOCALES := en_US.UTF-8 tr_TR.UTF-8 cs_CZ.UTF-8 fa_IR.UTF-8 fr_FR.UTF-8 \ ja_JP.UTF-8 si_LK.UTF-8 en_GB.UTF-8 vi_VN.UTF-8 ar_SA.UTF-8 \ @@ -51,6 +59,7 @@ LOCALES := en_US.UTF-8 tr_TR.UTF-8 cs_CZ.UTF-8 fa_IR.UTF-8 fr_FR.UTF-8 \ he_IL.UTF-8 is_IS.UTF-8 es_ES.UTF-8 hi_IN.UTF-8 sv_SE.UTF-8 \ hu_HU.UTF-8 it_IT.UTF-8 sr_RS.UTF-8 zh_CN.UTF-8 include ../gen-locales.mk +endif stdlib-benchset := strtod @@ -131,10 +140,16 @@ bench-clean: rm -f $(timing-type) $(addsuffix .o,$(timing-type)) rm -f $(addprefix $(objpfx),$(bench-extra-objs)) -bench: $(timing-type) $(gen-locales) bench-build bench-set bench-func \ - bench-malloc -# Target to only build the benchmark without running it. -bench-build: $(binaries-bench) $(binaries-benchset) $(binaries-bench-malloc) +bench: bench-build bench-set bench-func bench-malloc +# Target to only build the benchmark without running it. We generate locales +# only if we're building natively. +ifeq (no,$(cross-compiling)) +bench-build: $(gen-locales) $(timing-type) $(binaries-bench) \ + $(binaries-benchset) $(binaries-bench-malloc) +else +bench-build: $(timing-type) $(binaries-bench) $(binaries-benchset) \ + $(binaries-bench-malloc) +endif bench-set: $(binaries-benchset) for run in $^; do \ diff --git a/benchtests/README b/benchtests/README index 847df87..2c5f381 100644 --- a/benchtests/README +++ b/benchtests/README @@ -49,7 +49,9 @@ benchmarks from the build directory as usual: $ make bench make sure the copy preserves timestamps by using either rsync or scp -p -otherwise the above command may try to build the benchmark again. +otherwise the above command may try to build the benchmark again. Benchmarks +that require generated code to be executed during the build are skipped when +cross-building. Adding a function to benchtests: ===============================