projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
btrace2fio: add rate output
[fio.git]
/
server.c
diff --git
a/server.c
b/server.c
index 077dce5c349f67efec5c76a6371e89e2a2a4724f..36713ee5716058fddf49f7213fe6d444b26b7c53 100644
(file)
--- a/
server.c
+++ b/
server.c
@@
-555,6
+555,7
@@
static int handle_run_cmd(struct flist_head *job_list, struct fio_net_cmd *cmd)
pid_t pid;
int ret;
pid_t pid;
int ret;
+ fio_time_init();
set_genesis_time();
pid = fork();
set_genesis_time();
pid = fork();
@@
-665,22
+666,14
@@
static int handle_probe_cmd(struct fio_net_cmd *cmd)
static int handle_send_eta_cmd(struct fio_net_cmd *cmd)
{
struct jobs_eta *je;
static int handle_send_eta_cmd(struct fio_net_cmd *cmd)
{
struct jobs_eta *je;
- size_t size;
uint64_t tag = cmd->tag;
uint64_t tag = cmd->tag;
+ size_t size;
int i;
int i;
- if (!thread_number)
+ je = get_jobs_eta(1, &size);
+ if (!je)
return 0;
return 0;
- size = sizeof(*je) + thread_number * sizeof(char) + 1;
- je = malloc(size);
- memset(je, 0, size);
-
- if (!calc_thread_status(je, 1)) {
- free(je);
- return 0;
- }
-
dprint(FD_NET, "server sending status\n");
je->nr_running = cpu_to_le32(je->nr_running);
dprint(FD_NET, "server sending status\n");
je->nr_running = cpu_to_le32(je->nr_running);
@@
-1184,7
+1177,7
@@
static int fio_send_iolog_gz(struct cmd_iolog_pdu *pdu, struct io_log *log)
}
stream.next_in = (void *) log->log;
}
stream.next_in = (void *) log->log;
- stream.avail_in = log->nr_samples *
sizeof(struct io_sample
);
+ stream.avail_in = log->nr_samples *
log_entry_sz(log
);
do {
unsigned int this_len, flags = 0;
do {
unsigned int this_len, flags = 0;
@@
-1221,8
+1214,8
@@
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
struct cmd_iolog_pdu pdu;
int i, ret = 0;
struct cmd_iolog_pdu pdu;
int i, ret = 0;
+ pdu.nr_samples = cpu_to_le64(log->nr_samples);
pdu.thread_number = cpu_to_le32(td->thread_number);
pdu.thread_number = cpu_to_le32(td->thread_number);
- pdu.nr_samples = __cpu_to_le32(log->nr_samples);
pdu.log_type = cpu_to_le32(log->log_type);
pdu.compressed = cpu_to_le32(use_zlib);
pdu.log_type = cpu_to_le32(log->log_type);
pdu.compressed = cpu_to_le32(use_zlib);
@@
-1230,12
+1223,18
@@
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
pdu.name[FIO_NET_NAME_MAX - 1] = '\0';
for (i = 0; i < log->nr_samples; i++) {
pdu.name[FIO_NET_NAME_MAX - 1] = '\0';
for (i = 0; i < log->nr_samples; i++) {
- struct io_sample *s = &log->log[i];
+ struct io_sample *s = get_sample(log, i);
+
+ s->time = cpu_to_le64(s->time);
+ s->val = cpu_to_le64(s->val);
+ s->__ddir = cpu_to_le32(s->__ddir);
+ s->bs = cpu_to_le32(s->bs);
- s->time = cpu_to_le64(s->time);
- s->val = cpu_to_le64(s->val);
- s->ddir = cpu_to_le32(s->ddir);
- s->bs = cpu_to_le32(s->bs);
+ if (log->log_offset) {
+ struct io_sample_offset *so = (void *) s;
+
+ so->offset = cpu_to_le64(so->offset);
+ }
}
/*
}
/*
@@
-1253,7
+1252,7
@@
int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
return fio_send_iolog_gz(&pdu, log);
return fio_send_cmd_ext_pdu(server_fd, FIO_NET_CMD_IOLOG, log->log,
return fio_send_iolog_gz(&pdu, log);
return fio_send_cmd_ext_pdu(server_fd, FIO_NET_CMD_IOLOG, log->log,
- log->nr_samples *
sizeof(struct io_sample
), 0, 0);
+ log->nr_samples *
log_entry_sz(log
), 0, 0);
}
void fio_server_send_add_job(struct thread_data *td)
}
void fio_server_send_add_job(struct thread_data *td)
@@
-1710,7
+1709,7
@@
int fio_start_server(char *pidfile)
int ret = write_pid(pid, pidfile);
free(pidfile);
int ret = write_pid(pid, pidfile);
free(pidfile);
- exit(ret);
+
_
exit(ret);
}
setsid();
}
setsid();