This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][PATCH 2/2] generic hp_timing
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Fri, 15 Jan 2016 11:09:16 -0200
- Subject: Re: [RFC][PATCH 2/2] generic hp_timing
- Authentication-results: sourceware.org; auth=none
- References: <005b01d14f84$f01c5100$d054f300$ at samsung dot com>
On 15-01-2016 09:07, Maria Guseva wrote:
> This is a second part of patch: generic time implementation.
> Please find my comments below:
>
>>> >> +#if HP_TIMING_AVAIL
>>> >> if (HP_SMALL_TIMING_AVAIL)
>>> >> HP_TIMING_NOW (_dl_cpuclock_offset);
>>> >> +#endif
>> >we should avoid CPP here imo. if !HP_TIMING_AVAIL, then shouldn't it already be !HP_SMALL_TIMING_AVAIL ? so you don't need the #if here.
> We have _dl_cpuclock_offset defined only in case of HP_TIMING_AVAIL. So without CPP check the compilation fails in generic case when HP_TIMING_NOW is still defined.
>
I think the idea is to just add an empty '_dl_cpuclock_offset' in the case of !HP_SMALL_TIMING_AVAIL
(or after your patch HP_TIMING_AVAIL) so this will be evaluated as am empty construction by the
compiler.
>> >also worth noting that we now require __NR_clock_gettime everywhere, so you can assume that rather than "#ifdef __NR_clock_gettime".
> Can you please add more details on this? I see there are still checks for "#ifdef __NR_clock_gettime" in other sources (e.g. nptl/pthread_cond_timedwait.c)
>
This is some old code that nobody had bothered to cleanup (Tovarld's new condvar might
get rid of it). The idea is you can assume now clock_gettime syscall is always
supported in all architectures.