The thread status display uses printf to stdout.
Need a way to capture it for the gui.
Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
#include "flist.h"
#include "hash.h"
+extern void (*update_thread_status)(char *status_message);
+
struct client_eta {
struct jobs_eta eta;
unsigned int pending;
handle_gs,
handle_eta,
handle_probe,
+ NULL, /* status display, if NULL, printf is used */
};
static struct timeval eta_tv;
init_thread_stat(&client_ts);
init_group_run_stat(&client_gs);
+ /* Used by eta.c:display_thread_status() */
+ update_thread_status = ops->thread_status_display;
+
while (!exit_backend && nr_clients) {
struct flist_head *entry, *tmp;
struct fio_client *client;
typedef void (*client_probe_op)(struct fio_client *client, struct fio_net_cmd *cmd);
+typedef void (*client_thread_status_display_op)(char *status_message);
+
struct client_ops {
client_text_op_func text_op;
client_disk_util_op_func disk_util;
client_group_stats_op group_stats;
client_eta_op eta;
client_probe_op probe;
+ client_thread_status_display_op thread_status_display;
};
extern struct client_ops fio_client_ops;
#include "fio.h"
+void (*update_thread_status)(char *status_message) = NULL;
+
static char run_str[REAL_MAX_JOBS + 1];
/*
}
p += sprintf(p, "\r");
- printf("%s", output);
- fflush(stdout);
+ if (update_thread_status) {
+ update_thread_status(output);
+ } else {
+ printf("%s", output);
+ fflush(stdout);
+ }
}
void print_thread_status(void)