From 61192be2eb8ecc87d35f2d0d31bf36f14766b338 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 14 Mar 2013 01:54:46 +0000 Subject: [PATCH] Cleanup: there's no point to count on_free latency, because those places are behind scst_update_lat_stats() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4793 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 2 +- scst/src/scst_lib.c | 25 +++---------------------- scst/src/scst_priv.h | 4 ---- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index 4a2e71184..8add0e10d 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2177,7 +2177,7 @@ struct scst_cmd { uint64_t start, curr_start, parse_time, alloc_buf_time; uint64_t restart_waiting_time, rdy_to_xfer_time; uint64_t pre_exec_time, exec_time, dev_done_time; - uint64_t xmit_time, tgt_on_free_time, dev_on_free_time; + uint64_t xmit_time; #endif #ifdef CONFIG_SCST_DEBUG_TM diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 4c192677e..467fc7ab7 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -5391,9 +5391,7 @@ static void scst_destroy_cmd(struct scst_cmd *cmd) if ((cmd->tgtt->on_free_cmd != NULL) && likely(!cmd->internal)) { TRACE_DBG("Calling target's on_free_cmd(%p)", cmd); - scst_set_cur_start(cmd); cmd->tgtt->on_free_cmd(cmd); - scst_set_tgt_on_free_time(cmd); TRACE_DBG("%s", "Target's on_free_cmd() returned"); } @@ -5434,9 +5432,7 @@ void scst_free_cmd(struct scst_cmd *cmd) if (devt->on_free_cmd != NULL) { TRACE_DBG("Calling dev handler %s on_free_cmd(%p)", devt->name, cmd); - scst_set_cur_start(cmd); devt->on_free_cmd(cmd); - scst_set_dev_on_free_time(cmd); TRACE_DBG("Dev handler %s on_free_cmd() returned", devt->name); } @@ -9539,18 +9535,6 @@ void scst_set_xmit_time(struct scst_cmd *cmd) TRACE_DBG("cmd %p: xmit_time %lld", cmd, cmd->xmit_time); } -void scst_set_tgt_on_free_time(struct scst_cmd *cmd) -{ - cmd->tgt_on_free_time += scst_get_nsec() - cmd->curr_start; - TRACE_DBG("cmd %p: tgt_on_free_time %lld", cmd, cmd->tgt_on_free_time); -} - -void scst_set_dev_on_free_time(struct scst_cmd *cmd) -{ - cmd->dev_on_free_time += scst_get_nsec() - cmd->curr_start; - TRACE_DBG("cmd %p: dev_on_free_time %lld", cmd, cmd->dev_on_free_time); -} - void scst_update_lat_stats(struct scst_cmd *cmd) { uint64_t finish, scst_time, tgt_time, dev_time; @@ -9582,13 +9566,10 @@ void scst_update_lat_stats(struct scst_cmd *cmd) scst_time = finish - cmd->start - (cmd->parse_time + cmd->alloc_buf_time + cmd->restart_waiting_time + cmd->rdy_to_xfer_time + cmd->pre_exec_time + - cmd->exec_time + cmd->dev_done_time + cmd->xmit_time + - cmd->tgt_on_free_time + cmd->dev_on_free_time); + cmd->exec_time + cmd->dev_done_time + cmd->xmit_time); tgt_time = cmd->alloc_buf_time + cmd->restart_waiting_time + - cmd->rdy_to_xfer_time + cmd->pre_exec_time + - cmd->xmit_time + cmd->tgt_on_free_time; - dev_time = cmd->parse_time + cmd->exec_time + cmd->dev_done_time + - cmd->dev_on_free_time; + cmd->rdy_to_xfer_time + cmd->pre_exec_time; + dev_time = cmd->parse_time + cmd->exec_time + cmd->dev_done_time; spin_lock_bh(&sess->lat_lock); diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 3aa9eeed2..bc8bb3900 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -758,8 +758,6 @@ void scst_set_pre_exec_time(struct scst_cmd *cmd); void scst_set_exec_time(struct scst_cmd *cmd); void scst_set_dev_done_time(struct scst_cmd *cmd); void scst_set_xmit_time(struct scst_cmd *cmd); -void scst_set_tgt_on_free_time(struct scst_cmd *cmd); -void scst_set_dev_on_free_time(struct scst_cmd *cmd); void scst_update_lat_stats(struct scst_cmd *cmd); #else @@ -774,8 +772,6 @@ static inline void scst_set_pre_exec_time(struct scst_cmd *cmd) {} static inline void scst_set_exec_time(struct scst_cmd *cmd) {} static inline void scst_set_dev_done_time(struct scst_cmd *cmd) {} static inline void scst_set_xmit_time(struct scst_cmd *cmd) {} -static inline void scst_set_tgt_on_free_time(struct scst_cmd *cmd) {} -static inline void scst_set_dev_on_free_time(struct scst_cmd *cmd) {} static inline void scst_update_lat_stats(struct scst_cmd *cmd) {} #endif /* CONFIG_SCST_MEASURE_LATENCY */