[PATCH v2 3/3] y2038: nptl: Convert pthread_rwlock_{clock|timed}{rd|wr}lock to support 64 bit time

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Sep 30 13:19:00 GMT 2020



On 30/09/2020 10:12, Lukasz Majewski wrote:
>>> diff --git a/nptl/pthread_rwlock_rdlock.c
>>> b/nptl/pthread_rwlock_rdlock.c index 04cecad395..2b8509a49c 100644
>>> --- a/nptl/pthread_rwlock_rdlock.c
>>> +++ b/nptl/pthread_rwlock_rdlock.c
>>> @@ -24,7 +24,7 @@ __pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
>>>  {
>>>    LIBC_PROBE (rdlock_entry, 1, rwlock);  
>>
>> We need to move the systemtap probe to the 64-bit variant, so the
>> 64-bit time will still trigger it.
> 
> Those are syscalls, which don't require timespec time.

These are in fact systemtap markers [1] and they are not related to 
syscalls.

> 
> The LIBC_PROBE() macros were there before, so I left them as is and
> only changed __pthread_rwlock_rdlock_full() to
> __pthread_rwlock_rdlock_full64().
> 
> 
> On the other hand - for example:
> __pthread_rwlock_clockwrlock() and __pthread_rwlock_clockwrlock64()
> are only calling __pthread_rwlock_wrlock_full64(), and there were no
> LIBC_PROBE() macros before.
> 
> Do I understand correctly that you propose to add LIBC_PROBE() macros
> to e.g. __pthread_rwlock_clockwrlock64() ?

The idea of the LIBC_PROBE is to trigger an systemtap even when the
function is called so systemtap can act accordingly (and the markers
are enable only if --enable-systemtap is used on configure).

Without moving the LIBC_PROBE, 64-bit time architectures won't see the 
probes anymore since they will call the 64-bit time version instead.

[1] https://sourceware.org/systemtap/wiki/glibcMarkers


More information about the Libc-alpha mailing list