Recent changes

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

 



The following changes since commit ee72ca09d4657f6a805c113d9bc43428f4b28a89:

  Sync HOWTO iodepth option with man page (2010-12-02 20:05:37 +0100)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Signed-off-by Steven Pratt (1):
      fix ramp_in

 eta.c  |    5 +++--
 fio.c  |   15 ++++++++-------
 fio.h  |    2 +-
 stat.c |    4 ++--
 4 files changed, 14 insertions(+), 12 deletions(-)

---

Diff of recent changes:

diff --git a/eta.c b/eta.c
index 608e0dd..ba6a398 100644
--- a/eta.c
+++ b/eta.c
@@ -161,12 +161,13 @@ static int thread_eta(struct thread_data *td)
 		 * if given, otherwise assume it'll run at the specified rate.
 		 */
 		if (td->o.timeout) {
-			t_eta = td->o.timeout + td->o.start_delay;
+			t_eta = td->o.timeout + td->o.start_delay +
+					td->o.ramp_time;
 
 			if (in_ramp_time(td)) {
 				unsigned long ramp_left;
 
-				ramp_left = mtime_since_now(&td->start);
+				ramp_left = mtime_since_now(&td->epoch);
 				ramp_left = (ramp_left + 999) / 1000;
 				if (ramp_left <= t_eta)
 					t_eta -= ramp_left;
diff --git a/fio.c b/fio.c
index 91bf6b6..8dff813 100644
--- a/fio.c
+++ b/fio.c
@@ -989,6 +989,8 @@ void reset_all_stats(struct thread_data *td)
 	}
 	
 	fio_gettime(&tv, NULL);
+	td->ts.runtime[0] = 0;
+	td->ts.runtime[1] = 0;
 	memcpy(&td->epoch, &tv, sizeof(tv));
 	memcpy(&td->start, &tv, sizeof(tv));
 }
@@ -1027,7 +1029,7 @@ static int exec_string(const char *string)
  */
 static void *thread_main(void *data)
 {
-	unsigned long long runtime[2], elapsed;
+	unsigned long long elapsed;
 	struct thread_data *td = data;
 	pthread_condattr_t attr;
 	int clear_state;
@@ -1145,7 +1147,6 @@ static void *thread_main(void *data)
 	fio_gettime(&td->epoch, NULL);
 	getrusage(RUSAGE_SELF, &td->ts.ru_start);
 
-	runtime[0] = runtime[1] = 0;
 	clear_state = 0;
 	while (keep_running(td)) {
 		fio_gettime(&td->start, NULL);
@@ -1170,11 +1171,11 @@ static void *thread_main(void *data)
 
 		if (td_read(td) && td->io_bytes[DDIR_READ]) {
 			elapsed = utime_since_now(&td->start);
-			runtime[DDIR_READ] += elapsed;
+			td->ts.runtime[DDIR_READ] += elapsed;
 		}
 		if (td_write(td) && td->io_bytes[DDIR_WRITE]) {
 			elapsed = utime_since_now(&td->start);
-			runtime[DDIR_WRITE] += elapsed;
+			td->ts.runtime[DDIR_WRITE] += elapsed;
 		}
 
 		if (td->error || td->terminate)
@@ -1191,15 +1192,15 @@ static void *thread_main(void *data)
 
 		do_verify(td);
 
-		runtime[DDIR_READ] += utime_since_now(&td->start);
+		td->ts.runtime[DDIR_READ] += utime_since_now(&td->start);
 
 		if (td->error || td->terminate)
 			break;
 	}
 
 	update_rusage_stat(td);
-	td->ts.runtime[0] = (runtime[0] + 999) / 1000;
-	td->ts.runtime[1] = (runtime[1] + 999) / 1000;
+	td->ts.runtime[0] = (td->ts.runtime[0] + 999) / 1000;
+	td->ts.runtime[1] = (td->ts.runtime[1] + 999) / 1000;
 	td->ts.total_run_time = mtime_since_now(&td->epoch);
 	td->ts.io_bytes[0] = td->io_bytes[0];
 	td->ts.io_bytes[1] = td->io_bytes[1];
diff --git a/fio.h b/fio.h
index 4ed8cb1..c04ad8b 100644
--- a/fio.h
+++ b/fio.h
@@ -126,7 +126,7 @@ struct thread_stat {
 	unsigned long total_complete;
 
 	unsigned long long io_bytes[2];
-	unsigned long runtime[2];
+	unsigned long long runtime[2];
 	unsigned long total_run_time;
 
 	/*
diff --git a/stat.c b/stat.c
index b5ff010..a596388 100644
--- a/stat.c
+++ b/stat.c
@@ -172,7 +172,7 @@ static void show_ddir_status(struct group_run_stats *rs, struct thread_stat *ts,
 	iops = (1000 * ts->total_io_u[ddir]) / runt;
 	iops_p = num2str(iops, 6, 1, 0);
 
-	log_info("  %s: io=%sB, bw=%sB/s, iops=%s, runt=%6lumsec\n",
+	log_info("  %s: io=%sB, bw=%sB/s, iops=%s, runt=%6llumsec\n",
 					ddir_str[ddir], io_p, bw_p, iops_p,
 					ts->runtime[ddir]);
 
@@ -380,7 +380,7 @@ static void show_ddir_status_terse(struct thread_stat *ts,
 	if (ts->runtime[ddir])
 		bw = ts->io_bytes[ddir] / ts->runtime[ddir];
 
-	log_info(";%llu;%llu;%lu", ts->io_bytes[ddir] >> 10, bw,
+	log_info(";%llu;%llu;%llu", ts->io_bytes[ddir] >> 10, bw,
 							ts->runtime[ddir]);
 
 	if (calc_lat(&ts->slat_stat[ddir], &min, &max, &mean, &dev))
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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