List Info

Thread: BTT PATCHES: Cleaned up patches for SEEK additions, DM, Q2A and seek fixes. (5/5)




BTT PATCHES: Cleaned up patches for SEEK additions, DM, Q2A and seek fixes. (5/5)
user name
2006-09-14 15:51:56
From: Alan D. Brunelle <Alan.Brunellehp.com>

Fixed problem with seek statistics when disk has no data.

---

 btt/output.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/btt/output.c b/btt/output.c
index 6973031..969ccae 100644
--- a/btt/output.c
+++ b/btt/output.c
 -293,16
+293,18  void __output_dip_seek_info(FILE *ofp, s
 	long long median, *modes;
 
 	nseeks = seeki_nseeks(dip->seek_handle);
-	mean = seeki_mean(dip->seek_handle);
-	median = seeki_median(dip->seek_handle);
-	nmodes = seeki_mode(dip->seek_handle, &modes,
&most_seeks);
-
-	fprintf(ofp, "%10s | %15lld %15.1lf %15lld |
%lld(%d)",
-		make_dev_hdr(dev_info, 12, dip), nseeks, mean, median, 
-		nmodes > 0 ? modes[0] : 0, most_seeks);
-	for (i = 1; i < nmodes; i++)
-		fprintf(ofp, " %lld", modes[i]);
-	fprintf(ofp, "\n");
+	if (nseeks > 0) {
+		mean = seeki_mean(dip->seek_handle);
+		median = seeki_median(dip->seek_handle);
+		nmodes = seeki_mode(dip->seek_handle, &modes,
&most_seeks);
+
+		fprintf(ofp, "%10s | %15lld %15.1lf %15lld |
%lld(%d)",
+			make_dev_hdr(dev_info, 12, dip), nseeks, mean, median, 
+			nmodes > 0 ? modes[0] : 0, most_seeks);
+		for (i = 1; i < nmodes; i++)
+			fprintf(ofp, " %lld", modes[i]);
+		fprintf(ofp, "\n");
+	}
 }
 
 void output_dip_seek_info(FILE *ofp)
BTT PATCHES: Cleaned up patches for SEEK additions, DM, Q2A and seek fixes. (5/5)
user name
2006-09-15 00:02:25
On Thu, Sep 14 2006, Alan D. Brunelle wrote:
> 

> From: Alan D. Brunelle <Alan.Brunellehp.com>
> 
> Fixed problem with seek statistics when disk has no
data.

Applied.


-- 
Jens Axboe

-
To unsubscribe from this list: send the line
"unsubscribe linux-btrace" in
the body of a message to majordomovger.kernel.org
More majordomo info at  http://vge
r.kernel.org/majordomo-info.html
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )