From f07eb7a5c90ecb60ce7335b5f871dd628da61e18 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 14 Oct 2009 16:20:19 +0000 Subject: [PATCH] - Add raw accumulated times in the latency statistics output - Minor cleanup git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1211 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/Makefile | 1 - scst/src/scst_proc.c | 111 ++++++++++++++++++++++++------------------- 2 files changed, 63 insertions(+), 49 deletions(-) diff --git a/scst/src/Makefile b/scst/src/Makefile index fe32dd015..42b63e769 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -134,7 +134,6 @@ EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG -g #EXTRA_CFLAGS += -DCONFIG_SCST_DEBUG_SN #EXTRA_CFLAGS += -DCONFIG_SCST_MEASURE_LATENCY -#EXTRA_CFLAGS += -DCONFIG_SCST_MEASURE_LATENCY_EXT # If defined, makes SCST zero allocated data buffers. # Undefining it considerably improves performance and eases CPU load, diff --git a/scst/src/scst_proc.c b/scst/src/scst_proc.c index df7d8296b..ab6009f8e 100644 --- a/scst/src/scst_proc.c +++ b/scst/src/scst_proc.c @@ -446,9 +446,9 @@ static int lat_info_show(struct seq_file *seq, void *v) unsigned int processed_cmds; if (!header_printed) { - seq_printf(seq, "%-15s %-15s %-34s %-34s %-34s\n", + seq_printf(seq, "%-15s %-15s %-46s %-46s %-46s\n", "T-L names", "Total commands", "SCST latency", - "Target latency", "Dev latency (min/avg/max ns)"); + "Target latency", "Dev latency (min/avg/max/all ns)"); header_printed = true; } @@ -482,25 +482,28 @@ static int lat_info_show(struct seq_file *seq, void *v) processed_cmds_wr = 1; do_div(scst_time_wr, processed_cmds_wr); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_scst_time_wr, (unsigned long)scst_time_wr, - (unsigned long)latency_stat->max_scst_time_wr); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_scst_time_wr, + (unsigned long)latency_stat->scst_time_wr); + seq_printf(seq, "%-47s", buf); do_div(tgt_time_wr, processed_cmds_wr); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_tgt_time_wr, (unsigned long)tgt_time_wr, - (unsigned long)latency_stat->max_tgt_time_wr); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_tgt_time_wr, + (unsigned long)latency_stat->tgt_time_wr); + seq_printf(seq, "%-47s", buf); do_div(dev_time_wr, processed_cmds_wr); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_dev_time_wr, (unsigned long)dev_time_wr, - (unsigned long)latency_stat->max_dev_time_wr); - seq_printf(seq, "%-35s\n", buf); + (unsigned long)latency_stat->max_dev_time_wr, + (unsigned long)latency_stat->dev_time_wr); + seq_printf(seq, "%-47s\n", buf); seq_printf(seq, "%-5s %-9s %-15lu ", "Read", scst_io_size_names[i], @@ -509,25 +512,28 @@ static int lat_info_show(struct seq_file *seq, void *v) processed_cmds_rd = 1; do_div(scst_time_rd, processed_cmds_rd); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_scst_time_rd, (unsigned long)scst_time_rd, - (unsigned long)latency_stat->max_scst_time_rd); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_scst_time_rd, + (unsigned long)latency_stat->scst_time_rd); + seq_printf(seq, "%-47s", buf); do_div(tgt_time_rd, processed_cmds_rd); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_tgt_time_rd, (unsigned long)tgt_time_rd, - (unsigned long)latency_stat->max_tgt_time_rd); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_tgt_time_rd, + (unsigned long)latency_stat->tgt_time_rd); + seq_printf(seq, "%-47s", buf); do_div(dev_time_rd, processed_cmds_rd); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_dev_time_rd, (unsigned long)dev_time_rd, - (unsigned long)latency_stat->max_dev_time_rd); - seq_printf(seq, "%-35s\n", buf); + (unsigned long)latency_stat->max_dev_time_rd, + (unsigned long)latency_stat->dev_time_rd); + seq_printf(seq, "%-47s\n", buf); } for (t = TGT_DEV_HASH_SIZE-1; t >= 0; t--) { @@ -563,25 +569,28 @@ static int lat_info_show(struct seq_file *seq, void *v) processed_cmds_wr = 1; do_div(scst_time_wr, processed_cmds_wr); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_scst_time_wr, (unsigned long)scst_time_wr, - (unsigned long)latency_stat->max_scst_time_wr); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_scst_time_wr, + (unsigned long)latency_stat->scst_time_wr); + seq_printf(seq, "%-47s", buf); do_div(tgt_time_wr, processed_cmds_wr); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_tgt_time_wr, (unsigned long)tgt_time_wr, - (unsigned long)latency_stat->max_tgt_time_wr); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_tgt_time_wr, + (unsigned long)latency_stat->tgt_time_wr); + seq_printf(seq, "%-47s", buf); do_div(dev_time_wr, processed_cmds_wr); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_dev_time_wr, (unsigned long)dev_time_wr, - (unsigned long)latency_stat->max_dev_time_wr); - seq_printf(seq, "%-35s\n", buf); + (unsigned long)latency_stat->max_dev_time_wr, + (unsigned long)latency_stat->dev_time_wr); + seq_printf(seq, "%-47s\n", buf); seq_printf(seq, "%-5s %-9s %-15lu ", "Read", scst_io_size_names[i], @@ -590,25 +599,28 @@ static int lat_info_show(struct seq_file *seq, void *v) processed_cmds_rd = 1; do_div(scst_time_rd, processed_cmds_rd); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_scst_time_rd, (unsigned long)scst_time_rd, - (unsigned long)latency_stat->max_scst_time_rd); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_scst_time_rd, + (unsigned long)latency_stat->scst_time_rd); + seq_printf(seq, "%-47s", buf); do_div(tgt_time_rd, processed_cmds_rd); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_tgt_time_rd, (unsigned long)tgt_time_rd, - (unsigned long)latency_stat->max_tgt_time_rd); - seq_printf(seq, "%-35s", buf); + (unsigned long)latency_stat->max_tgt_time_rd, + (unsigned long)latency_stat->tgt_time_rd); + seq_printf(seq, "%-47s", buf); do_div(dev_time_rd, processed_cmds_rd); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)latency_stat->min_dev_time_rd, (unsigned long)dev_time_rd, - (unsigned long)latency_stat->max_dev_time_rd); - seq_printf(seq, "%-35s\n", buf); + (unsigned long)latency_stat->max_dev_time_rd, + (unsigned long)latency_stat->dev_time_rd); + seq_printf(seq, "%-47s\n", buf); } } } @@ -618,32 +630,35 @@ static int lat_info_show(struct seq_file *seq, void *v) dev_time = sess->dev_time; processed_cmds = sess->processed_cmds; - seq_printf(seq, "%-15s %-16d", "Overall ", + seq_printf(seq, "\n%-15s %-16d", "Overall ", processed_cmds); if (processed_cmds == 0) processed_cmds = 1; do_div(scst_time, processed_cmds); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)sess->min_scst_time, (unsigned long)scst_time, - (unsigned long)sess->max_scst_time); - seq_printf(seq, "%-35s", buf); + (unsigned long)sess->max_scst_time, + (unsigned long)sess->scst_time); + seq_printf(seq, "%-47s", buf); do_div(tgt_time, processed_cmds); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)sess->min_tgt_time, (unsigned long)tgt_time, - (unsigned long)sess->max_tgt_time); - seq_printf(seq, "%-35s", buf); + (unsigned long)sess->max_tgt_time, + (unsigned long)sess->tgt_time); + seq_printf(seq, "%-47s", buf); do_div(dev_time, processed_cmds); - snprintf(buf, sizeof(buf), "%lu/%lu/%lu", + snprintf(buf, sizeof(buf), "%lu/%lu/%lu/%lu", (unsigned long)sess->min_dev_time, (unsigned long)dev_time, - (unsigned long)sess->max_dev_time); - seq_printf(seq, "%-35s\n\n", buf); + (unsigned long)sess->max_dev_time, + (unsigned long)sess->dev_time); + seq_printf(seq, "%-47s\n\n", buf); spin_unlock_bh(&sess->lat_lock); }