From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Andreas Schwab <schwab@suse.de>,
Alistair Francis <alistair.francis@wdc.com>,
"H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>,
Joseph Myers <joseph@codesourcery.com>
Subject: Re: [PATCH] Fix __clock_gettime64 with _ISOMAC in sysdeps/generic/hp-timing.h
Date: Thu, 28 May 2020 16:28:55 +0200 [thread overview]
Message-ID: <87sgfk9lqw.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOoAYVdK6KYqzvU3EeEDc0ufFh-xej_K08DcXXf+qdz-+A@mail.gmail.com> (H. J. Lu's message of "Thu, 28 May 2020 06:07:20 -0700")
* H. J. Lu:
> On Thu, May 28, 2020 at 5:58 AM Florian Weimer <fweimer@redhat.com> 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 <stdint.h>
>> > #include <hp-timing-common.h>
>> >
>> > +#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.
Thanks,
Florian
next prev parent reply other threads:[~2020-05-28 14:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 18:16 [PATCH v3] y2038: Replace __clock_gettime with __clock_gettime64 Lukasz Majewski
2020-05-19 19:51 ` Lukasz Majewski
2020-05-20 10:29 ` Andreas Schwab
2020-05-21 1:09 ` H.J. Lu via Libc-alpha
2020-05-21 10:24 ` Lukasz Majewski
2020-05-21 11:11 ` H.J. Lu via Libc-alpha
2020-05-23 20:32 ` [PATCH] Fix __clock_gettime64 for sysdeps/generic/hp-timing.h H.J. Lu via Libc-alpha
2020-05-24 9:03 ` Lukasz Majewski
2020-05-24 11:39 ` H.J. Lu via Libc-alpha
2020-05-24 15:30 ` Lukasz Majewski
2020-05-24 16:13 ` H.J. Lu via Libc-alpha
2020-05-24 23:34 ` V2 " H.J. Lu via Libc-alpha
2020-05-25 10:40 ` Lukasz Majewski
2020-05-25 10:57 ` [PATCH v3] y2038: Replace __clock_gettime with __clock_gettime64 Andreas Schwab
2020-05-27 12:44 ` Florian Weimer via Libc-alpha
2020-05-27 12:47 ` H.J. Lu via Libc-alpha
2020-05-27 12:50 ` Florian Weimer via Libc-alpha
2020-05-28 12:28 ` [PATCH] Fix __clock_gettime64 with _ISOMAC in sysdeps/generic/hp-timing.h H.J. Lu via Libc-alpha
2020-05-28 12:58 ` Florian Weimer via Libc-alpha
2020-05-28 13:07 ` H.J. Lu via Libc-alpha
2020-05-28 14:28 ` Florian Weimer via Libc-alpha [this message]
2020-05-28 14:50 ` [PATCH] Update HP_TIMING_NOW for " H.J. Lu via Libc-alpha
2020-06-05 16:26 ` Carlos O'Donell via Libc-alpha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sgfk9lqw.fsf@oldenburg2.str.redhat.com \
--to=libc-alpha@sourceware.org \
--cc=alistair.francis@wdc.com \
--cc=fweimer@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=joseph@codesourcery.com \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).