diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c index 181811baa..d825e1e7c 100644 --- a/scst/src/scst_proc.c +++ b/scst/src/scst_proc.c @@ -425,7 +425,7 @@ static int lat_info_show(struct seq_file *seq, void *v) "Target name", "Initiator name", "SCST latency", - "Processing latency (us)"); + "Processing latency (ns)"); list_for_each_entry(acg, &scst_acg_list, scst_acg_list_entry) { list_for_each_entry(sess, &acg->acg_sess_list, @@ -499,6 +499,7 @@ static ssize_t scst_proc_scsi_tgt_gen_write_lat(struct file *file, sess->initiator_name); spin_lock_bh(&sess->meas_lock); sess->processing_time = 0; + sess->scst_time = 0; sess->processed_cmds = 0; spin_unlock_bh(&sess->meas_lock); } diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 96eb6fd53..d4308606a 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "scst.h" #include "scst_priv.h" @@ -198,7 +199,7 @@ void scst_cmd_init_done(struct scst_cmd *cmd, #ifdef CONFIG_SCST_MEASURE_LATENCY { struct timespec ts; - getnstimeofday(&ts); + ktime_get_ts(&ts); cmd->start = scst_sec_to_nsec(ts.tv_sec) + ts.tv_nsec; TRACE_DBG("cmd %p (sess %p): start %lld (tv_sec %ld, " "tv_nsec %ld)", cmd, sess, cmd->start, ts.tv_sec, @@ -1192,7 +1193,7 @@ static void scst_do_cmd_done(struct scst_cmd *cmd, int result, #ifdef CONFIG_SCST_MEASURE_LATENCY { struct timespec ts; - getnstimeofday(&ts); + ktime_get_ts(&ts); cmd->post_exec_start = scst_sec_to_nsec(ts.tv_sec) + ts.tv_nsec; TRACE_DBG("cmd %p (sess %p): post_exec_start %lld (tv_sec %ld, " "tv_nsec %ld)", cmd, cmd->sess, cmd->post_exec_start, @@ -1332,7 +1333,7 @@ static void scst_cmd_done_local(struct scst_cmd *cmd, int next_state, #ifdef CONFIG_SCST_MEASURE_LATENCY { struct timespec ts; - getnstimeofday(&ts); + ktime_get_ts(&ts); cmd->post_exec_start = scst_sec_to_nsec(ts.tv_sec) + ts.tv_nsec; TRACE_DBG("cmd %p (sess %p): post_exec_start %lld (tv_sec %ld, " "tv_nsec %ld)", cmd, cmd->sess, cmd->post_exec_start, @@ -2324,7 +2325,7 @@ static int scst_send_for_exec(struct scst_cmd **active_cmd) #ifdef CONFIG_SCST_MEASURE_LATENCY if (cmd->pre_exec_finish == 0) { struct timespec ts; - getnstimeofday(&ts); + ktime_get_ts(&ts); cmd->pre_exec_finish = scst_sec_to_nsec(ts.tv_sec) + ts.tv_nsec; TRACE_DBG("cmd %p (sess %p): pre_exec_finish %lld (tv_sec %ld, " "tv_nsec %ld)", cmd, cmd->sess, cmd->pre_exec_finish, @@ -2941,7 +2942,7 @@ out: struct timespec ts; uint64_t finish, scst_time, proc_time; - getnstimeofday(&ts); + ktime_get_ts(&ts); finish = scst_sec_to_nsec(ts.tv_sec) + ts.tv_nsec; spin_lock_bh(&sess->meas_lock);