diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index acf80e6543b..ea241658c03 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -52,14 +52,17 @@ SMBPROFILE_STATS_BASIC(syscall_close) \ SMBPROFILE_STATS_BYTES(syscall_read) \ SMBPROFILE_STATS_BYTES(syscall_pread) \ + SMBPROFILE_STATS_BYTES(syscall_asys_pread) \ SMBPROFILE_STATS_BYTES(syscall_write) \ SMBPROFILE_STATS_BYTES(syscall_pwrite) \ + SMBPROFILE_STATS_BYTES(syscall_asys_pwrite) \ SMBPROFILE_STATS_BASIC(syscall_lseek) \ SMBPROFILE_STATS_BYTES(syscall_sendfile) \ SMBPROFILE_STATS_BYTES(syscall_recvfile) \ SMBPROFILE_STATS_BASIC(syscall_rename) \ SMBPROFILE_STATS_BASIC(syscall_rename_at) \ SMBPROFILE_STATS_BASIC(syscall_fsync) \ + SMBPROFILE_STATS_BASIC(syscall_asys_fsync) \ SMBPROFILE_STATS_BASIC(syscall_stat) \ SMBPROFILE_STATS_BASIC(syscall_fstat) \ SMBPROFILE_STATS_BASIC(syscall_lstat) \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 5fb3b1c1e1d..2ac7100cd74 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -687,6 +687,8 @@ struct vfswrap_asys_state { struct tevent_req *req; ssize_t ret; int err; + SMBPROFILE_BASIC_ASYNC_STATE(profile_basic); + SMBPROFILE_BYTES_ASYNC_STATE(profile_bytes); }; static int vfswrap_asys_state_destructor(struct vfswrap_asys_state *s) @@ -717,6 +719,8 @@ static struct tevent_req *vfswrap_pread_send(struct vfs_handle_struct *handle, state->asys_ctx = handle->conn->sconn->asys_ctx; state->req = req; + SMBPROFILE_BYTES_ASYNC_START(syscall_asys_pread, profile_p, + state->profile_bytes, n); ret = asys_pread(state->asys_ctx, fsp->fh->fd, data, n, offset, req); if (ret != 0) { tevent_req_error(req, ret); @@ -749,6 +753,8 @@ static struct tevent_req *vfswrap_pwrite_send(struct vfs_handle_struct *handle, state->asys_ctx = handle->conn->sconn->asys_ctx; state->req = req; + SMBPROFILE_BYTES_ASYNC_START(syscall_asys_pwrite, profile_p, + state->profile_bytes, n); ret = asys_pwrite(state->asys_ctx, fsp->fh->fd, data, n, offset, req); if (ret != 0) { tevent_req_error(req, ret); @@ -779,6 +785,8 @@ static struct tevent_req *vfswrap_fsync_send(struct vfs_handle_struct *handle, state->asys_ctx = handle->conn->sconn->asys_ctx; state->req = req; + SMBPROFILE_BASIC_ASYNC_START(syscall_asys_fsync, profile_p, + state->profile_basic); ret = asys_fsync(state->asys_ctx, fsp->fh->fd, req); if (ret != 0) { tevent_req_error(req, ret); @@ -822,6 +830,8 @@ static void vfswrap_asys_finished(struct tevent_context *ev, talloc_set_destructor(state, NULL); + SMBPROFILE_BASIC_ASYNC_END(state->profile_basic); + SMBPROFILE_BYTES_ASYNC_END(state->profile_bytes); state->ret = result->ret; state->err = result->err; tevent_req_defer_callback(req, ev);