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,
};
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;