This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH 2/2] generic hp_timing



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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]