static void handle_text(struct fio_client *client, struct fio_net_cmd *cmd);
static void handle_stop(struct fio_client *client, struct fio_net_cmd *cmd);
static void handle_start(struct fio_client *client, struct fio_net_cmd *cmd);
+static void handle_iolog(struct fio_client *client, struct cmd_iolog_pdu *pdu);
struct client_ops fio_client_ops = {
.text = handle_text,
.start = handle_start,
.eta = display_thread_status,
.probe = handle_probe,
+ .iolog = handle_iolog,
.eta_msec = FIO_CLIENT_DEF_ETA_MSEC,
.client_type = FIO_CLIENT_TYPE_CLI,
};
return;
pdu->global = le16_to_cpu(pdu->global);
- pdu->groupid = le16_to_cpu(pdu->groupid);
+ pdu->truncated = le16_to_cpu(pdu->truncated);
+ pdu->groupid = le32_to_cpu(pdu->groupid);
p = malloc(sizeof(*p));
p->name = strdup((char *) pdu->name);
fio_client_dec_jobs_eta(eta, client->ops->eta);
}
+static void handle_iolog(struct fio_client *client, struct cmd_iolog_pdu *pdu)
+{
+ FILE *f;
+
+ printf("got log compressed; %d\n", pdu->compressed);
+
+ f = fopen((const char *) pdu->name, "w");
+ if (!f) {
+ perror("fopen log");
+ return;
+ }
+
+ flush_samples(f, pdu->samples,
+ pdu->nr_samples * sizeof(struct io_sample));
+ fclose(f);
+}
+
static void handle_probe(struct fio_client *client, struct fio_net_cmd *cmd)
{
struct cmd_probe_reply_pdu *probe = (struct cmd_probe_reply_pdu *) cmd->payload;
static int handle_cmd_timeout(struct fio_client *client,
struct fio_net_cmd_reply *reply)
{
+ flist_del(&reply->list);
+ free(reply);
+
if (reply->opcode != FIO_NET_CMD_SEND_ETA)
return 1;
log_info("client <%s>: timeout on SEND_ETA\n", client->hostname);
- flist_del(&reply->list);
- free(reply);
flist_del_init(&client->eta_list);
if (client->eta_in_flight) {
log_err("fio: client %s, timeout on cmd %s\n", client->hostname,
fio_server_op(reply->opcode));
- flist_del(&reply->list);
- free(reply);
ret = 1;
}