[PATCH] Steadystate fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jens, the attached patch is for the steady-state branch.

With this patch the feature should have the original functionality,
although the list of items in the TODO is unchanged.

Vincent

--
Vincent Fu
Software Dev Engr II
SanDisk, a Western Digital brand
Email: Vincent.Fu@xxxxxxxxxxx
Office: 801 987 7079

PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).
From f01f287a90203a5be05f3ff08f6c03e2576cd5fb Mon Sep 17 00:00:00 2001
From: Vincent Fu <Vincent.Fu@xxxxxxxxxxx>
Date: Thu, 27 Oct 2016 16:36:43 -0400
Subject: [PATCH] Steadystate fixes

1) Fix steadystate option parsing callback bu
2) Re-insert missing multiplier in slope calculation
3) Revert 'attained' in the JSON output to be either 0 or 1
---
 options.c     | 2 +-
 stat.c        | 2 +-
 steadystate.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/options.c b/options.c
index 6f3752f..3af604b 100644
--- a/options.c
+++ b/options.c
@@ -1063,7 +1063,7 @@ static int str_random_distribution_cb(void *data, const char *str)
 
 static int str_steadystate_cb(void *data, const char *str)
 {
-	struct thread_data *td = data;
+	struct thread_data *td = cb_data_to_td(data);
 	double val;
 	char *nr;
 	char *pct;
diff --git a/stat.c b/stat.c
index 0eb87bd..c41ac89 100644
--- a/stat.c
+++ b/stat.c
@@ -1276,7 +1276,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
 		json_object_add_value_string(tmp, "ss", ss_buf);
 		json_object_add_value_int(tmp, "duration", (int)ss->dur);
 		json_object_add_value_int(tmp, "steadystate_ramptime", ss->ramp_time / 1000000L);
-		json_object_add_value_int(tmp, "attained", ss->state & __FIO_SS_ATTAINED);
+		json_object_add_value_int(tmp, "attained", (ss->state & __FIO_SS_ATTAINED) > 0);
 
 		snprintf(ss_buf, sizeof(ss_buf), "%f%s", (float) ss->criterion, ss->pct ? "%" : "");
 		json_object_add_value_string(tmp, "criterion", ss_buf);
diff --git a/steadystate.c b/steadystate.c
index 235deac..1f53ae4 100644
--- a/steadystate.c
+++ b/steadystate.c
@@ -84,9 +84,9 @@ static bool steadystate_slope(unsigned long iops, unsigned long bw,
 				if (j >= ss->dur)
 					j -= ss->dur;
 				if (ss->state & __FIO_SS_IOPS)
-					ss->sum_xy += ss->iops_data[j];
+					ss->sum_xy += i * ss->iops_data[j];
 				else
-					ss->sum_xy += ss->bw_data[j];
+					ss->sum_xy += i * ss->bw_data[j];
 			}
 		} else {		/* easy to update the sums */
 			ss->sum_y -= ss->oldest_y;
-- 
2.7.4 (Apple Git-66)


[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux