Skip to contentSkip to conversation

Recent changes (master)

PATCH Jens Axboe 1 participant 1 message Jun 28, 2014

lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

The following changes since commit 4445856ab659ffa41bdb8f5b81aa00704c50a5c6:

Verify: Tighten header length check in verify_header() (2014-06-26 19:30:16 +0200)

are available in the git repository at:

git://git.kernel.dk/fio.git master

for you to fetch changes up to 372d89627cc04b5f30193ad8df762f86a580596d:

Fix typo in io_u.c::get_next_file() (2014-06-27 20:21:22 -0600)

----------------------------------------------------------------
Andrey Kuzmin (1):
Fix typo in io_u.c::get_next_file()

Jens Axboe (3):
Fix struct jobs_eta packing on 32 vs 64-bit archs
eta: only pass real size of jobs_eta
client: fix ETA run_str

 client.c |   10 +++++++---
 eta.c    |    1 +
 io_u.c   |    2 +-
 stat.h   |    5 +++++
 4 files changed, 14 insertions(+), 4 deletions(-)

---

Diff of recent changes:

client.c +7 -3
index af6621d..828dd97 100644
@@ -987,7 +987,12 @@ void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je)
 		dst->eta_sec = je->eta_sec;
 
 	dst->nr_threads		+= je->nr_threads;
-	/* we need to handle je->run_str too ... */
+
+	/*
+	 * This wont be correct for multiple strings, but at least it
+	 * works for the basic cases.
+	 */
+	strcpy((char *) dst->run_str, (char *) je->run_str);
 }
 
 void fio_client_dec_jobs_eta(struct client_eta *eta, client_eta_op eta_fn)
@@ -1374,8 +1379,7 @@ static void request_client_etas(struct client_ops *ops)
 
 	dprint(FD_NET, "client: request eta (%d)\n", nr_clients);
 
-	eta = malloc(sizeof(*eta));
-	memset(&eta->eta, 0, sizeof(eta->eta));
+	eta = calloc(1, sizeof(*eta) + __THREAD_RUNSTR_SZ(REAL_MAX_JOBS));
 	eta->pending = nr_clients;
 
 	flist_for_each(entry, &client_list) {
eta.c +1 -0
index 850a784..0105cda 100644
@@ -581,6 +581,7 @@ struct jobs_eta *get_jobs_eta(int force, size_t *size)
 		return NULL;
 	}
 
+	*size = sizeof(*je) + strlen((char *) je->run_str) + 1;
 	return je;
 }
 
io_u.c +1 -1
index e132fd9..997e113 100644
@@ -1100,7 +1100,7 @@ out:
 
 static struct fio_file *get_next_file(struct thread_data *td)
 {
-	if (!(td->flags & TD_F_PROFILE_OPS)) {
+	if (td->flags & TD_F_PROFILE_OPS) {
 		struct prof_io_ops *ops = &td->prof_io_ops;
 
 		if (ops->get_next_file)
stat.h +5 -0
index 6f9d82a..fb1485d 100644
@@ -186,9 +186,13 @@ struct thread_stat {
 struct jobs_eta {
 	uint32_t nr_running;
 	uint32_t nr_ramp;
+
 	uint32_t nr_pending;
 	uint32_t nr_setting_up;
+
 	uint32_t files_open;
+	uint32_t pad1;
+
 	uint32_t m_rate[DDIR_RWDIR_CNT], t_rate[DDIR_RWDIR_CNT];
 	uint32_t m_iops[DDIR_RWDIR_CNT], t_iops[DDIR_RWDIR_CNT];
 	uint32_t rate[DDIR_RWDIR_CNT];
@@ -202,6 +206,7 @@ struct jobs_eta {
 	 * Network 'copy' of run_str[]
 	 */
 	uint32_t nr_threads;
+	uint32_t pad2;
 	uint8_t run_str[];
 };