IMPORT: plock: always expose the inline version of the lock wait function

Doing so will allow to expose the time spent in certain highly
contended functions, which can be desirable for more accurate CPU
profiling. For example this could be done in locking functions that
are already not inlined so that they are the ones being reported as
those consuming the CPU instead of just pl_wait_unlock_long().

This is plock upstream commit 7505c2e2c8c4aa0ab8f52a2288e1334ae6412be4.
This commit is contained in:
Willy Tarreau 2023-08-16 22:29:45 +02:00
parent c6b98f05d2
commit 66dcc0550e
1 changed files with 22 additions and 10 deletions

View File

@ -75,12 +75,8 @@
_r; /* return value */ \
})
#else /* not PLOCK_DISABLE_EBO */
# if defined(PLOCK_INLINE_EBO)
__attribute__((unused,always_inline,no_instrument_function)) inline
# else
__attribute__((unused,noinline,no_instrument_function))
# endif
static unsigned long pl_wait_unlock_long(const unsigned long *lock, const unsigned long mask)
static unsigned long __pl_wait_unlock_long(const unsigned long *lock, const unsigned long mask)
{
unsigned long ret;
unsigned int m = 0;
@ -113,6 +109,16 @@ static unsigned long pl_wait_unlock_long(const unsigned long *lock, const unsign
return ret;
}
# if defined(PLOCK_INLINE_EBO)
__attribute__((unused,always_inline,no_instrument_function)) inline
# else
__attribute__((unused,noinline,no_instrument_function))
# endif
static unsigned long pl_wait_unlock_long(const unsigned long *lock, const unsigned long mask)
{
return __pl_wait_unlock_long(lock, mask);
}
#endif /* PLOCK_DISABLE_EBO */
/* This function waits for <lock> to release all bits covered by <mask>, and
@ -138,12 +144,8 @@ static unsigned long pl_wait_unlock_long(const unsigned long *lock, const unsign
_r; /* return value */ \
})
#else
# if defined(PLOCK_INLINE_EBO)
__attribute__((unused,always_inline,no_instrument_function)) inline
# else
__attribute__((unused,noinline,no_instrument_function))
# endif
static unsigned int pl_wait_unlock_int(const unsigned int *lock, const unsigned int mask)
static unsigned int __pl_wait_unlock_int(const unsigned int *lock, const unsigned int mask)
{
unsigned int ret;
unsigned int m = 0;
@ -176,6 +178,16 @@ static unsigned int pl_wait_unlock_int(const unsigned int *lock, const unsigned
return ret;
}
# if defined(PLOCK_INLINE_EBO)
__attribute__((unused,always_inline,no_instrument_function)) inline
# else
__attribute__((unused,noinline,no_instrument_function))
# endif
static unsigned int pl_wait_unlock_int(const unsigned int *lock, const unsigned int mask)
{
return __pl_wait_unlock_int(lock, mask);
}
#endif /* PLOCK_DISABLE_EBO */
/* This function waits for <lock> to change from value <prev> and returns the