X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=client.h;h=4146607ea6c35df036763cfc220f4f04839fad45;hb=3e47bd250cac5fb81a5c0ad578dfbe90c6ddf6de;hp=150d1334539b77d65b305f75663caa53ccb557e8;hpb=65d0a0aa0c4e5ed39b804f5f83d311093af798c5;p=fio.git diff --git a/client.h b/client.h index 150d1334..4146607e 100644 --- a/client.h +++ b/client.h @@ -1,9 +1,49 @@ #ifndef CLIENT_H #define CLIENT_H -struct fio_client; +#include +#include +#include +#include + +#include "stat.h" + struct fio_net_cmd; +struct fio_client { + struct flist_head list; + struct flist_head hash_list; + struct flist_head arg_list; + union { + struct sockaddr_in addr; + struct sockaddr_in6 addr6; + struct sockaddr_un addr_un; + }; + char *hostname; + int port; + int fd; + + char *name; + + int state; + + int skip_newline; + int is_sock; + int disk_stats_shown; + unsigned int jobs; + int error; + int ipv6; + int sent_job; + + struct flist_head eta_list; + struct client_eta *eta_in_flight; + + struct flist_head cmd_list; + + uint16_t argc; + char **argv; +}; + typedef void (*client_text_op_func)(struct fio_client *client, FILE *f, __u16 pdu_len, const char *buf); @@ -24,12 +64,21 @@ struct client_ops { client_disk_util_op_func disk_util; client_thread_status_op thread_status; client_group_stats_op group_stats; - client_eta_op eta; + client_eta_op eta; client_probe_op probe; - client_thread_status_display_op thread_status_display; }; extern struct client_ops fio_client_ops; +struct client_eta { + struct jobs_eta eta; + unsigned int pending; +}; + +extern int fio_handle_client(struct fio_client *, struct client_ops *ops); +extern void fio_client_dec_jobs_eta(struct client_eta *eta, void (*fn)(struct jobs_eta *)); +extern void fio_client_sum_jobs_eta(struct jobs_eta *dst, struct jobs_eta *je); +extern void fio_client_convert_jobs_eta(struct jobs_eta *je); + #endif