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-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 9B5DE1F55B for ; Fri, 5 Jun 2020 16:26:36 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 808C638930C7; Fri, 5 Jun 2020 16:26:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 808C638930C7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1591374395; bh=0PaPoPRAH4lsimjT6NBEzfrqIINw5lIKT2ti4fUVr74=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=mpmkgZCi1AQIMXKFgc+2BeYQDIaGcACeeghR7X9DtgRq08NEYPEowlCfEDOdWpMMe 94AEGoaLWey5A1ZtQACe+aaaRnJrVFdeQNzgtOKTwNzY1ZnR2KWERJZvG4ivlsrRaC DRdLr+KJfFBUmFF0lJBdlDB32Ij2JjFa2gbiKEO8= Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 0CF353851C3A for ; Fri, 5 Jun 2020 16:26:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CF353851C3A Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-ektw6wtpM-qfaBzXNd3a_Q-1; Fri, 05 Jun 2020 12:26:30 -0400 X-MC-Unique: ektw6wtpM-qfaBzXNd3a_Q-1 Received: by mail-qv1-f70.google.com with SMTP id w12so7922084qvh.13 for ; Fri, 05 Jun 2020 09:26:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0PaPoPRAH4lsimjT6NBEzfrqIINw5lIKT2ti4fUVr74=; b=XnVbH9w+ZwY/XuJlWi2g+RZB+J2QHBJ2SP2n4rf58CEmNzVugiiF6cP7z4GJT9e9CO tzdwWKRpLKAOuOhZsMTQt3vGihwpfyRZ+X1KdYkI3ZB9Xw1OkpLC2ToPGon2dYCWgY9D tmlRzssptmDfn3nXHWpoZf0Y/2voPAJl3BbbtvS6c7FTgZVVcE7BUNCOspHLfR6RP47a iif0dKAxGeqhFnFiw5hy6Sbq5dQq7mm47yNrDTFbjQylebdBTRdLrNhdIQAxcnbugr2h UqHCd56LsTkkdxdlkjLVo4h8w7sO07vnOx9z60ydJ+t/aW0BBBp2NLnFkha1oRFWaAgA mS/g== X-Gm-Message-State: AOAM530e0jCiln5C/z5NLpOH7JVavCpZzIjLbf0dDuDcYY0M42tkzG4M LXdflOQ9D7JKLjHicf0KnMEcqDjLtvP1Z4MSq3wMy+piCUSz4Lqvmn/pU9BX+PH4GNxQHf9YrYf DJNoWSA9/XeIY2dGr3hif X-Received: by 2002:aed:21a4:: with SMTP id l33mr7918372qtc.72.1591374388759; Fri, 05 Jun 2020 09:26:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk8yNCuQDK3srWRG8KwYHZf1+NfMekQwxpgWSzZfwZj6D+KE4ukNs+u8WAtx0JEoBJ+CCL9Q== X-Received: by 2002:aed:21a4:: with SMTP id l33mr7918343qtc.72.1591374388390; Fri, 05 Jun 2020 09:26:28 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id n13sm233250qtb.20.2020.06.05.09.26.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jun 2020 09:26:27 -0700 (PDT) Subject: Re: [PATCH] Update HP_TIMING_NOW for _ISOMAC in sysdeps/generic/hp-timing.h To: "H.J. Lu" , Florian Weimer References: <20200505181605.22346-1-lukma@denx.de> <87v9kkmgcw.fsf@igel.home> <87367lk0nk.fsf@oldenburg2.str.redhat.com> <87y2pdiltl.fsf@oldenburg2.str.redhat.com> <87sgfkb4ij.fsf@oldenburg2.str.redhat.com> <87sgfk9lqw.fsf@oldenburg2.str.redhat.com> Organization: Red Hat Message-ID: <96f6414d-ea0a-eab7-8603-c66af51e02bb@redhat.com> Date: Fri, 5 Jun 2020 12:26:26 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Cc: Andreas Schwab , "H.J. Lu via Libc-alpha" , Alistair Francis , Joseph Myers Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On 5/28/20 10:50 AM, H.J. Lu via Libc-alpha wrote: > On Thu, May 28, 2020 at 7:29 AM Florian Weimer wrote: >> >> * H. J. Lu: >> >>> On Thu, May 28, 2020 at 5:58 AM Florian Weimer wrote: >>>> >>>> * H. J. Lu via Libc-alpha: >>>> >>>>> diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h >>>>> index af9d92f7f7..99b12995f1 100644 >>>>> --- a/sysdeps/generic/hp-timing.h >>>>> +++ b/sysdeps/generic/hp-timing.h >>>>> @@ -24,6 +24,11 @@ >>>>> #include >>>>> #include >>>>> >>>>> +#ifdef _ISOMAC >>>>> +# define __timespec64 timespec >>>>> +# define __clock_gettime64 clock_gettime >>>>> +#endif >>>>> + >>>>> /* It should not be used for ld.so. */ >>>>> #define HP_TIMING_INLINE (0) >>>> >>>> To be honest, I would have expected different definitions of the timing >>>> macros. This redirection looks a bit iffy for me for _ISOMAC. >>> >>> What do you have in mind? >> >> Something like this: >> >> /* The clock_gettime (CLOCK_MONOTONIC) has unspecified starting time, >> nano-second accuracy, and for some architectues is implemented as >> vDSO symbol. */ >> #ifdef _ISOMAC >> # define HP_TIMING_NOW(var) \ >> ({ \ >> struct timespec tv; \ >> clock_gettime (CLOCK_MONOTONIC, &tv); \ >> (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ >> }) >> #else >> # define HP_TIMING_NOW(var) \ >> ({ \ >> struct __timespec64 tv; \ >> __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ >> (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ >> }) >> #endif >> >> in sysdeps/generic/hp-timing.h. >> > > Here is the updated patch. OK for master? OK for master. Reviewed-by: Carlos O'Donell > From f312c52fa80828ecdc473594e160ef2f5d2a00d7 Mon Sep 17 00:00:00 2001 > From: "H.J. Lu" > Date: Sat, 23 May 2020 10:04:20 -0700 > Subject: [PATCH] Update HP_TIMING_NOW for _ISOMAC in > sysdeps/generic/hp-timing.h > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > commit e9698175b0b60407db1e89bcf29437ab224bca0b > Author: Lukasz Majewski > Date: Mon Mar 16 08:31:41 2020 +0100 > > y2038: Replace __clock_gettime with __clock_gettime64 > > breaks benchtests with sysdeps/generic/hp-timing.h: Yes, Patsy Griffin in testing for Fedora Rawhide has seen this for aarch64, s390x, and armv7hl. Patsy is testing this patch now. > In file included from ./bench-timing.h:23, > from ./bench-skeleton.c:25, > from > /export/build/gnu/tools-build/glibc-gitlab/build-x86_64-linux/benchtests/bench-rint.c:45: > ./bench-skeleton.c: In function ‘main’: > ../sysdeps/generic/hp-timing.h:37:23: error: storage size of ‘tv’ isn’t known > 37 | struct __timespec64 tv; \ > | ^~ > > Define HP_TIMING_NOW with clock_gettime in sysdeps/generic/hp-timing.h > if _ISOMAC is defined. Don't define __clock_gettime in bench-timing.h > since it is no longer needed. OK. > --- > benchtests/bench-timing.h | 1 - > sysdeps/generic/hp-timing.h | 11 ++++++++++- > 2 files changed, 10 insertions(+), 2 deletions(-) > > diff --git a/benchtests/bench-timing.h b/benchtests/bench-timing.h > index a0d6f82465..d0176fb76e 100644 > --- a/benchtests/bench-timing.h > +++ b/benchtests/bench-timing.h > @@ -18,7 +18,6 @@ > > #undef attribute_hidden > #define attribute_hidden > -#define __clock_gettime __clock_gettime64 OK. > #include > #include > > diff --git a/sysdeps/generic/hp-timing.h b/sysdeps/generic/hp-timing.h > index af9d92f7f7..1960a71c62 100644 > --- a/sysdeps/generic/hp-timing.h > +++ b/sysdeps/generic/hp-timing.h > @@ -32,11 +32,20 @@ typedef uint64_t hp_timing_t; > /* The clock_gettime (CLOCK_MONOTONIC) has unspecified starting time, > nano-second accuracy, and for some architectues is implemented as > vDSO symbol. */ > -#define HP_TIMING_NOW(var) \ > +#ifdef _ISOMAC > +# define HP_TIMING_NOW(var) \ > +({ \ > + struct timespec tv; \ > + clock_gettime (CLOCK_MONOTONIC, &tv); \ > + (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ > +}) > +#else > +# define HP_TIMING_NOW(var) \ OK. > ({ \ > struct __timespec64 tv; \ > __clock_gettime64 (CLOCK_MONOTONIC, &tv); \ > (var) = (tv.tv_nsec + UINT64_C(1000000000) * tv.tv_sec); \ > }) > +#endif > > #endif /* hp-timing.h */ > -- > 2.26.2 > -- Cheers, Carlos.