summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
83742c7)
Even with the local storage, for some operations we still end up
having to do split dumps. Include the buffer in the actual client,
and flush when the client is done.
Hopefully this fixes the remaining buffer output split for
client/server.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
if (--client->refs)
return;
if (--client->refs)
return;
+ log_info_buf(client->buf.buf, client->buf.buflen);
+ buf_output_free(&client->buf);
+
free(client->hostname);
if (client->argv)
free(client->argv);
free(client->hostname);
if (client->argv)
free(client->argv);
-struct fio_client *fio_client_add_explicit(struct client_ops *ops,
- const char *hostname, int type,
- int port)
+static struct fio_client *get_new_client(void)
{
struct fio_client *client;
{
struct fio_client *client;
INIT_FLIST_HEAD(&client->eta_list);
INIT_FLIST_HEAD(&client->cmd_list);
INIT_FLIST_HEAD(&client->eta_list);
INIT_FLIST_HEAD(&client->cmd_list);
+ buf_output_init(&client->buf);
+
+ return client;
+}
+
+struct fio_client *fio_client_add_explicit(struct client_ops *ops,
+ const char *hostname, int type,
+ int port)
+{
+ struct fio_client *client;
+
+ client = get_new_client();
+
client->hostname = strdup(hostname);
if (type == Fio_client_socket)
client->hostname = strdup(hostname);
if (type == Fio_client_socket)
- client = malloc(sizeof(*client));
- memset(client, 0, sizeof(*client));
-
- INIT_FLIST_HEAD(&client->list);
- INIT_FLIST_HEAD(&client->hash_list);
- INIT_FLIST_HEAD(&client->arg_list);
- INIT_FLIST_HEAD(&client->eta_list);
- INIT_FLIST_HEAD(&client->cmd_list);
+ client = get_new_client();
if (fio_server_parse_string(hostname, &client->hostname,
&client->is_sock, &client->port,
if (fio_server_parse_string(hostname, &client->hostname,
&client->is_sock, &client->port,
if (client->opt_lists && p->ts.thread_number <= client->jobs)
opt_list = &client->opt_lists[p->ts.thread_number - 1];
if (client->opt_lists && p->ts.thread_number <= client->jobs)
opt_list = &client->opt_lists[p->ts.thread_number - 1];
- tsobj = show_thread_status(&p->ts, &p->rs, opt_list, NULL);
+ tsobj = show_thread_status(&p->ts, &p->rs, opt_list, &client->buf);
client->did_stat = true;
if (tsobj) {
json_object_add_client_info(tsobj, client);
client->did_stat = true;
if (tsobj) {
json_object_add_client_info(tsobj, client);
if (++sum_stat_nr == sum_stat_clients) {
strcpy(client_ts.name, "All clients");
if (++sum_stat_nr == sum_stat_clients) {
strcpy(client_ts.name, "All clients");
- tsobj = show_thread_status(&client_ts, &client_gs, NULL, NULL);
+ tsobj = show_thread_status(&client_ts, &client_gs, NULL, &client->buf);
if (tsobj) {
json_object_add_client_info(tsobj, client);
json_array_add_value_object(clients_array, tsobj);
if (tsobj) {
json_object_add_client_info(tsobj, client);
json_array_add_value_object(clients_array, tsobj);
struct group_run_stats *gs = (struct group_run_stats *) cmd->payload;
if (output_format & FIO_OUTPUT_NORMAL)
struct group_run_stats *gs = (struct group_run_stats *) cmd->payload;
if (output_format & FIO_OUTPUT_NORMAL)
- show_group_stats(gs, NULL);
+ show_group_stats(gs, &client->buf);
}
static void handle_job_opt(struct fio_client *client, struct fio_net_cmd *cmd)
}
static void handle_job_opt(struct fio_client *client, struct fio_net_cmd *cmd)
static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd)
{
struct cmd_du_pdu *du = (struct cmd_du_pdu *) cmd->payload;
static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd)
{
struct cmd_du_pdu *du = (struct cmd_du_pdu *) cmd->payload;
- struct buf_output out;
-
- buf_output_init(&out);
if (!client->disk_stats_shown) {
client->disk_stats_shown = true;
if (!(output_format & FIO_OUTPUT_JSON))
if (!client->disk_stats_shown) {
client->disk_stats_shown = true;
if (!(output_format & FIO_OUTPUT_JSON))
- __log_buf(&out, "\nDisk stats (read/write):\n");
+ __log_buf(&client->buf, "\nDisk stats (read/write):\n");
}
if (output_format & FIO_OUTPUT_JSON) {
struct json_object *duobj;
}
if (output_format & FIO_OUTPUT_JSON) {
struct json_object *duobj;
json_array_add_disk_util(&du->dus, &du->agg, du_array);
duobj = json_array_last_value_object(du_array);
json_object_add_client_info(duobj, client);
}
if (output_format & FIO_OUTPUT_TERSE)
json_array_add_disk_util(&du->dus, &du->agg, du_array);
duobj = json_array_last_value_object(du_array);
json_object_add_client_info(duobj, client);
}
if (output_format & FIO_OUTPUT_TERSE)
- print_disk_util(&du->dus, &du->agg, 1, &out);
+ print_disk_util(&du->dus, &du->agg, 1, &client->buf);
if (output_format & FIO_OUTPUT_NORMAL)
if (output_format & FIO_OUTPUT_NORMAL)
- print_disk_util(&du->dus, &du->agg, 0, &out);
- buf_output_free(&out);
+ print_disk_util(&du->dus, &du->agg, 0, &client->buf);
}
static void convert_jobs_eta(struct jobs_eta *je)
}
static void convert_jobs_eta(struct jobs_eta *je)
struct client_file *files;
unsigned int nr_files;
struct client_file *files;
unsigned int nr_files;
+
+ struct buf_output buf;
};
typedef void (client_cmd_op)(struct fio_client *, struct fio_net_cmd *);
};
typedef void (client_cmd_op)(struct fio_client *, struct fio_net_cmd *);