From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 555A31F8C6 for ; Mon, 9 Aug 2021 20:09:14 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3D8D63938C22 for ; Mon, 9 Aug 2021 20:09:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3D8D63938C22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628539753; bh=IuwW1nY91uFNRJ8gnT4LYGkT1KS/j4+BG+1CVfQbsCk=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=HOrfo6Lvao8KrAI8CiNg5NFcIiG9eQ73eX607xkjHzHbi0sSX2Bg1Comwnib8eOCL j3LQr9CQUx0kRwQ2BSMqbQZTcu5IAMcETrJFuDcZnvcUgwdTIknJarRjFfpURSg73s zX9VukGV0Ft/3QNiacqu2KxeCuaMuMa3Nke+NGCg= Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by sourceware.org (Postfix) with ESMTPS id 77B2438A8867 for ; Mon, 9 Aug 2021 20:07:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77B2438A8867 Received: by mail-pj1-x1036.google.com with SMTP id u21-20020a17090a8915b02901782c36f543so681092pjn.4 for ; Mon, 09 Aug 2021 13:07:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=axzzKHG9yZS860a3EirElqr76DWCJb/yOtz2iFd2+Oc=; b=XEGro5NBPprd3ALWkS0XNo7JOOzIwjGVZtNXZO4bzmQx8r35pehMYg38y8GDJeGVI/ ZpJ0UC4fGdIGyyNDcgUgCItEHf/D4tMqGYeCKsCQzwSut5MA3myLz4FEnNeiidcPcq8e oSMbYcOG0U/7+iGP7oTrHTtHRtjMjQnsckFHy1EzoZZzkiicCR9FfCHhzeza5Y1mjyxA auLwUknLioS7GEMQuyCMTsc7fcCIpMRdcb7+KqFACvqnFA1GBaRNVqFh+I9DKuyMMyg6 pgDApLz3UfO3GbYxy1mRF0tf2OHgcOU3CL6v/+igHMQOOVm+T9aTYzK8qpOPRlW0DQfS Dd3w== X-Gm-Message-State: AOAM532/5+IvtA7aikrSlscOUeeUGrVHWPMAsh0FgpICNH2GwK47LnVu XYegeRG2QCMVxvo5M9WyxhgKa5SJS7XsxGMdpkU= X-Google-Smtp-Source: ABdhPJynXlxk7Gg4d6Lcmk2UP36t6WS2kSOy/oCTPgJwhXJhNB5duwJtK0K5r6MhFWw8yvFsETaXTU35xlnJSFmb7bU= X-Received: by 2002:aa7:860e:0:b029:3bd:7e49:7a14 with SMTP id p14-20020aa7860e0000b02903bd7e497a14mr25891943pfn.40.1628539634665; Mon, 09 Aug 2021 13:07:14 -0700 (PDT) MIME-Version: 1.0 References: <20210730212204.1832487-1-hjl.tools@gmail.com> In-Reply-To: Date: Mon, 9 Aug 2021 16:07:03 -0400 Message-ID: Subject: Re: [PATCH] benchtests: Building benchmarks as static executables To: "H.J. Lu" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: , From: Noah Goldstein via Libc-alpha Reply-To: Noah Goldstein Cc: GNU C Library Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On Mon, Aug 9, 2021 at 3:34 PM H.J. Lu wrote: > On Mon, Aug 9, 2021 at 12:10 PM Noah Goldstein > wrote: > > > > > > > > On Fri, Jul 30, 2021 at 5:22 PM H.J. Lu via Libc-alpha < > libc-alpha@sourceware.org> wrote: > >> > >> Building benchmarks as static executables: > >> ========================================= > >> > >> To build benchmarks as static executables, on the build system, run: > >> > >> $ make STATIC-BENCHTESTS=yes bench-build > >> > > > > Any chance you could add a -falign option for this? > > To build glibc or build a specific bench test? > I think the functions being benchmarked are the important ones so if that's what you mean by a specific bench test then that should be good. The entire build would be fine as well imho. > > >> > >> You can copy benchmark executables to another machine and run them > >> without copying the source nor build directories. > >> --- > >> benchtests/Makefile | 26 +++++++++++++++++++------- > >> benchtests/README | 10 ++++++++++ > >> 2 files changed, 29 insertions(+), 7 deletions(-) > >> > >> diff --git a/benchtests/Makefile b/benchtests/Makefile > >> index 1530939a8c..4fcd73131a 100644 > >> --- a/benchtests/Makefile > >> +++ b/benchtests/Makefile > >> @@ -110,11 +110,23 @@ else > >> bench-malloc := $(filter malloc-%,${BENCHSET}) > >> endif > >> > >> -$(addprefix $(objpfx)bench-,$(bench-math)): $(libm) > >> -$(addprefix $(objpfx)bench-,$(math-benchset)): $(libm) > >> -$(addprefix $(objpfx)bench-,$(bench-pthread)): $(shared-thread-library) > >> -$(addprefix $(objpfx)bench-,$(bench-malloc)): $(shared-thread-library) > >> -$(addprefix $(objpfx)bench-,pthread-locks): $(libm) > >> +ifeq (${STATIC-BENCHTESTS},yes) > >> ++link-benchtests = $(+link-static-tests) > >> +link-libc-benchtests = $(link-libc-static) > >> +libm-benchtests = $(common-objpfx)math/libm.a > >> +thread-library-benchtests = $(static-thread-library) > >> +else > >> +link-libc-benchtests = $(link-libc) > >> ++link-benchtests = $(+link-tests) > >> +thread-library-benchtests = $(shared-thread-library) > >> +libm-benchtests = $(libm) > >> +endif > >> + > >> +$(addprefix $(objpfx)bench-,$(bench-math)): $(libm-benchtests) > >> +$(addprefix $(objpfx)bench-,$(math-benchset)): $(libm-benchtests) > >> +$(addprefix $(objpfx)bench-,$(bench-pthread)): > $(thread-library-benchtests) > >> +$(addprefix $(objpfx)bench-,$(bench-malloc)): > $(thread-library-benchtests) > >> +$(addprefix $(objpfx)bench-,pthread-locks): $(libm-benchtests) > >> > >> > >> > >> @@ -270,9 +282,9 @@ bench-link-targets = $(timing-type) > $(binaries-bench) $(binaries-benchset) \ > >> > >> $(bench-link-targets): %: %.o $(objpfx)json-lib.o \ > >> $(link-extra-libs-tests) \ > >> - $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \ > >> + $(sort $(filter $(common-objpfx)lib%,$(link-libc-benchtests))) \ > >> $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit) > >> - $(+link-tests) > >> + $(+link-benchtests) > >> > >> $(bench-link-targets): LDFLAGS += $(link-bench-bind-now) > >> > >> diff --git a/benchtests/README b/benchtests/README > >> index 44736d7e63..4d83a05b4b 100644 > >> --- a/benchtests/README > >> +++ b/benchtests/README > >> @@ -62,6 +62,16 @@ 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. > >> > >> +Building benchmarks as static executables: > >> +========================================= > >> + > >> +To build benchmarks as static executables, on the build system, run: > >> + > >> + $ make STATIC-BENCHTESTS=yes bench-build > >> + > >> +You can copy benchmark executables to another machine and run them > >> +without copying the source nor build directories. > >> + > >> Running subsets of benchmarks: > >> ============================== > >> > >> -- > >> 2.31.1 > >> > > > -- > H.J. >