Define SIGUSR1 to inform fio to dump run stats while continuing to run

For long running jobs, it may be interesting to see the stats without
having to terminate the job. Set up SIGUSR1 so that it does that,
gives you the stats at that point in time.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/client.c b/client.c
index 5b5d60a..5dcc5f5 100644
--- a/client.c
+++ b/client.c
@@ -401,6 +401,11 @@
 	fio_clients_terminate();
 }
 
+static void sig_show_status(int sig)
+{
+	show_running_run_stats();
+}
+
 static void client_signal_handler(void)
 {
 	struct sigaction act;
@@ -414,6 +419,11 @@
 	act.sa_handler = sig_int;
 	act.sa_flags = SA_RESTART;
 	sigaction(SIGTERM, &act, NULL);
+
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = sig_show_status;
+	act.sa_flags = SA_RESTART;
+	sigaction(SIGUSR1, &act, NULL);
 }
 
 static int send_client_cmd_line(struct fio_client *client)