summaryrefslogtreecommitdiff
path: root/source3/include/smbprofile.h
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2010-09-14 22:40:51 +0200
committerBjörn Jacke <bj@sernet.de>2010-09-14 22:45:07 +0200
commit4e8d6a779c9aa9b9418b4f835d831ad4492c3f6c (patch)
tree725e0c44d84840787a4f3707e8cf97da7a5e1810 /source3/include/smbprofile.h
parent5f6a145800a9e67c638f3ee05e43bb12fafffb48 (diff)
downloadsamba-4e8d6a779c9aa9b9418b4f835d831ad4492c3f6c.tar.gz
samba-4e8d6a779c9aa9b9418b4f835d831ad4492c3f6c.tar.bz2
samba-4e8d6a779c9aa9b9418b4f835d831ad4492c3f6c.zip
s3/profile: remove the magical clock initialization from the profile code
there's no point in not profiling times if no monotonic clock is found - monotonic and realtime clock are equally fast. Just use clock_gettime_mono instead.
Diffstat (limited to 'source3/include/smbprofile.h')
-rw-r--r--source3/include/smbprofile.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 60764794fc..5015d2a9e4 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -894,18 +894,13 @@ extern bool do_profile_times;
#define DEC_PROFILE_COUNT(x) profile_p->x--
#define ADD_PROFILE_COUNT(x,y) profile_p->x += (y)
-extern clockid_t __profile_clock;
-
static inline uint64_t profile_timestamp(void)
{
struct timespec ts;
- /* FIXME: On a single-CPU system, or a system where we have bound
- * daemon threads to single CPUs (eg. using cpusets or processor
- * affinity), it might be preferable to use CLOCK_PROCESS_CPUTIME_ID.
- */
-
- clock_gettime(__profile_clock, &ts);
+ /* we might prefer to use the _COARSE clock variant of CLOCK_MONOTONIC
+ that one is faster but cached and "just" tick-wise precise */
+ clock_gettime_mono(&ts);
return (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); /* usec */
}