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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.3 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,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 (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 dcvr.yhbt.net (Postfix) with ESMTPS id 5523220248 for ; Mon, 4 Mar 2019 17:35:43 +0000 (UTC) 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:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=thlopAxy0aVGkVtD0BH2W6Ik8Lo7R rN/5NDlVtOBOlHrhqBkAx8EBaUunaXK0jx5PWq0gN7bUXVdLOXBZG2zhtczNsHgX HHjuDObc+1WWGMKy4DijcBSeKZMWJ0PNl7Fw3B9DuiYx5FVbfB3Tz5+QEsLEAos+ fy+wz67RMbq41M= 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:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=nJMJ9kgBqeIZU83gGoaLvSf8c3w=; b=fPN dTxhm/h1HIu2bntUQFldeGQ+6XjmXdqnQuGr5jWLMuy3pK2Vl7WpFG8OxI/0w54j V2Q1Qy/uWP1xFatldqplbKoJLKA+Xv2lu90XGepmPuNlSXF0dVrtqiN0AGI3Z/nl 53nL593ghbhZjiIe4xjoUQJeSW5nX163oO0YAYfc= Received: (qmail 26639 invoked by alias); 4 Mar 2019 17:35: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 Received: (qmail 26626 invoked by uid 89); 4 Mar 2019 17:35:39 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2N35Upv07ARqNRcXcur0AmIc8LdLHWNOs9ZJ/lNRgUk=; b=DrAiqYcCjccIPglAOxhjdY9D37VHLRzMwyO1J2T6FwP8wg++vATtGPAQvmIh+/uHMoKElEwMEegBE9BiC2OLzG7dOsLtmN3vE2iy0FJe6gxYwNg6q7iI8HPNd2MWJd2/0ndCnnSZvom5TmLRkW2ULSC4fqJREsw5BfTpZXrtTwo= From: Wilco Dijkstra To: Carlos O'Donell , 'GNU C Library' CC: nd , Florian Weimer Subject: Re: [PATCH] Add malloc micro benchmark Date: Mon, 4 Mar 2019 17:35:34 +0000 Message-ID: References: ,<8ef46134-94fa-ffba-8f98-13a10a956e7b@redhat.com> In-Reply-To: <8ef46134-94fa-ffba-8f98-13a10a956e7b@redhat.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-exchange-purlcount: 1 received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED Hi Carlos, > BUILDSTDERR: bench-malloc-simple.c: In function 'bench': > BUILDSTDERR: bench-malloc-simple.c:89:17: error: variable 'res' set but n= ot used [-Werror=3Dunused-but-set-variable] > BUILDSTDERR:=A0=A0=A0 89 |=A0=A0 unsigned long res; > BUILDSTDERR:=A0=A0=A0=A0=A0=A0 |=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 ^~~ > BUILDSTDERR: cc1: all warnings being treated as errors > > Affects aarch64, armv7hl, and s390x. >=20 > I assume we need a "(void) res" like we have in bench-malloc-thread.c? >=20 > I'm going to checkin a quick fix to Rawhide and report back if anything > else breaks. Does that enable extra errors somehow? I can't reproduce it. Anyway TIMING_INIT is redundant for bench-malloc-*.c, so here's a patch to just kill it: Remove TIMING_INIT since it's only used in bench-skeleton.c if there is no hp-timing support (which will become the default after [1]). [1] https://sourceware.org/ml/libc-alpha/2019-02/msg00468.html ChangeLog: 2019-03-04 Wilco Dijkstra * benchtests/bench-malloc-simple.c: Remove TIMING_INIT. * benchtests/bench-malloc-thread.c: Likewise. * benchtests/bench-skeleton.c: Likewise. * benchtests/bench-strtod.c: Likewise. * benchtests/bench-timing.h: Likewise. -- diff --git a/benchtests/bench-malloc-simple.c b/benchtests/bench-malloc-sim= ple.c index 83203ff3187654a1710c9ef81016f854957b9d64..b8bb2cc116953c6691c17633d18= c5661c7d9243e 100644 --- a/benchtests/bench-malloc-simple.c +++ b/benchtests/bench-malloc-simple.c @@ -86,9 +86,6 @@ bench (unsigned long size) { size_t iters =3D NUM_ITERS; int **arr =3D (int**) malloc (MAX_ALLOCS * sizeof (void*)); - unsigned long res; - - TIMING_INIT (res); =20 for (int t =3D 0; t <=3D 3; t++) for (int i =3D 0; i < NUM_ALLOCS; i++) diff --git a/benchtests/bench-malloc-thread.c b/benchtests/bench-malloc-thr= ead.c index bb4ba727a88059ecbe7305f5b8ad1693c1f1f266..52261425b0f1af32c17328ea5e0= a5bb6f230df47 100644 --- a/benchtests/bench-malloc-thread.c +++ b/benchtests/bench-malloc-thread.c @@ -225,7 +225,6 @@ main (int argc, char **argv) { timing_t cur; size_t iters =3D 0, num_threads =3D 1; - unsigned long res; json_ctx_t json_ctx; double d_total_s, d_total_i; struct sigaction act; @@ -261,10 +260,6 @@ main (int argc, char **argv) =20 json_attr_object_begin (&json_ctx, ""); =20 - TIMING_INIT (res); - - (void) res; - memset (&act, 0, sizeof (act)); act.sa_handler =3D &alarm_handler; =20 diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c index 37625c4296882268f6260d99adbc7f0295164ffc..854151e5a82028e74fe3a966e82= 004572542f411 100644 --- a/benchtests/bench-skeleton.c +++ b/benchtests/bench-skeleton.c @@ -48,14 +48,11 @@ main (int argc, char **argv) =20 memset (&runtime, 0, sizeof (runtime)); =20 - unsigned long iters, res; + unsigned long iters =3D 1000; =20 #ifdef BENCH_INIT BENCH_INIT (); #endif - TIMING_INIT (res); - - iters =3D 1000 * res; =20 json_init (&json_ctx, 2, stdout); =20 diff --git a/benchtests/bench-strtod.c b/benchtests/bench-strtod.c index 4de0b9acb67eb925a80249322957ce8b3c08c8d6..d5b2503553ef74f33cace919ae9= c62f79cd11c9c 100644 --- a/benchtests/bench-strtod.c +++ b/benchtests/bench-strtod.c @@ -89,9 +89,6 @@ int do_bench (void) { const size_t iters =3D INNER_LOOP_ITERS; - timing_t res __attribute__ ((unused)); - - TIMING_INIT (res); =20 for (size_t i =3D 0; inputs[i] !=3D NULL; ++i) { diff --git a/benchtests/bench-timing.h b/benchtests/bench-timing.h index 41b7324527b9deed67b3479cb1308fbd291bc5ca..f9b19fcd29efb45ea02c375e37c= aba94c93956d1 100644 --- a/benchtests/bench-timing.h +++ b/benchtests/bench-timing.h @@ -28,8 +28,6 @@ typedef hp_timing_t timing_t; =20 # define TIMING_TYPE "hp_timing" =20 -# define TIMING_INIT(res) ({ (res) =3D 1; }) - # define TIMING_NOW(var) HP_TIMING_NOW (var) # define TIMING_DIFF(diff, start, end) HP_TIMING_DIFF ((diff), (start), (e= nd)) # define TIMING_ACCUM(sum, diff) HP_TIMING_ACCUM_NT ((sum), (diff)) @@ -41,15 +39,6 @@ typedef uint64_t timing_t; =20 # define TIMING_TYPE "clock_gettime" =20 -/* Measure the resolution of the clock so we can scale the number of - benchmark iterations by this value. */ -# define TIMING_INIT(res) \ -({ \ - struct timespec start; \ - clock_getres (CLOCK_PROCESS_CPUTIME_ID, &start); \ - (res) =3D start.tv_nsec; \ -}) - # define TIMING_NOW(var) \ ({ \ struct timespec tv; \