This is a get-timestamp macro which works only when
profiling is enabled in the build. The underlying
clock_gettime_mono() function can be costly on some
architectures and we want to avoid it if it's not
necessary.
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
#define END_PROFILE_BYTES(x) \
SMBPROFILE_BYTES_ASYNC_END(__profasync_##x)
+#define PROFILE_TIMESTAMP(x) clock_gettime_mono(x)
+
#else /* WITH_PROFILE */
#define SMBPROFILE_COUNT_INCREMENT(_name, _area, _v)
#define END_PROFILE(x)
#define END_PROFILE_BYTES(x)
+#define PROFILE_TIMESTAMP(x) (*(x)=(struct timespec){0})
+
static inline bool smbprofile_dump_pending(void)
{
return false;