vfs_aio_fork: call clock_gettime_mono() only on profile-enabled build
authorUri Simchoni <uri@samba.org>
Mon, 28 Mar 2016 07:19:49 +0000 (10:19 +0300)
committerJeremy Allison <jra@samba.org>
Mon, 28 Mar 2016 18:45:16 +0000 (20:45 +0200)
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_aio_fork.c

index a7221025f9638e86aea635d9710361f1a05d2b10..e699fc5d27f55d029e76e6ba99018ed975269316 100644 (file)
@@ -29,6 +29,7 @@
 #include "lib/util/sys_rw.h"
 #include "lib/util/sys_rw_data.h"
 #include "lib/msghdr.h"
+#include "smbprofile.h"
 
 #if !defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL) && !defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS)
 # error Can not pass file descriptors
@@ -343,7 +344,7 @@ static void aio_child_loop(int sockfd, struct mmap_area *map)
 
                ZERO_STRUCT(ret_struct);
 
-               clock_gettime_mono(&start);
+               PROFILE_TIMESTAMP(&start);
 
                switch (cmd_struct.cmd) {
                case READ_CMD:
@@ -370,7 +371,7 @@ static void aio_child_loop(int sockfd, struct mmap_area *map)
                        errno = EINVAL;
                }
 
-               clock_gettime_mono(&end);
+               PROFILE_TIMESTAMP(&end);
                ret_struct.duration = nsec_time_diff(&end, &start);
                DEBUG(10, ("aio_child_loop: syscall returned %d\n",
                           (int)ret_struct.size));