diff options
author | Ralph Boehme <slow@samba.org> | 2016-02-26 10:52:39 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-03-02 01:22:14 +0100 |
commit | 1e2d8d2c37f03208a12c6a868ef0e03d51191887 (patch) | |
tree | 7f7d002eb26b9f835b826339e891c1f5485026a8 /source3/modules | |
parent | c3892aa705cea3de0e0fd03de0c0a2f8a8fad669 (diff) | |
download | samba-1e2d8d2c37f03208a12c6a868ef0e03d51191887.tar.gz |
vfs/aio_linux: measure libaio aio function call duration
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_aio_linux.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/modules/vfs_aio_linux.c b/source3/modules/vfs_aio_linux.c index b1d33b59dad..caa3149a0e8 100644 --- a/source3/modules/vfs_aio_linux.c +++ b/source3/modules/vfs_aio_linux.c @@ -140,6 +140,7 @@ struct aio_linux_state { struct iocb event_iocb; ssize_t ret; struct vfs_aio_state vfs_aio_state; + struct timespec start; }; static struct tevent_req *aio_linux_pread_send( @@ -167,6 +168,7 @@ static struct tevent_req *aio_linux_pread_send( piocb = &state->event_iocb; + clock_gettime_mono(&state->start); ret = io_submit(io_ctx, 1, &piocb); if (ret < 0) { tevent_req_error(req, -ret); @@ -203,6 +205,7 @@ static struct tevent_req *aio_linux_pwrite_send( piocb = &state->event_iocb; + clock_gettime_mono(&state->start); ret = io_submit(io_ctx, 1, &piocb); if (ret < 0) { tevent_req_error(req, -ret); @@ -237,6 +240,7 @@ static struct tevent_req *aio_linux_fsync_send( piocb = &state->event_iocb; + clock_gettime_mono(&state->start); ret = io_submit(io_ctx, 1, &piocb); if (ret < 0) { tevent_req_error(req, -ret); @@ -252,10 +256,13 @@ static void aio_linux_done(struct tevent_context *event_ctx, uint16_t flags, void *private_data) { uint64_t num_events = 0; + struct timespec end; DEBUG(10, ("aio_linux_done called with flags=%d\n", (int)flags)); + clock_gettime_mono(&end); + /* Read the number of events available. */ if (sys_read(event_fd, &num_events, sizeof(num_events)) != sizeof(num_events)) { @@ -293,6 +300,7 @@ static void aio_linux_done(struct tevent_context *event_ctx, } else { state->ret = finished.res; } + state->vfs_aio_state.duration = nsec_time_diff(&end, &state->start); tevent_req_done(req); num_events -= 1; } |