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/backend.c b/backend.c
index 4c271ba..f4bc553 100644
--- a/backend.c
+++ b/backend.c
@@ -87,6 +87,11 @@
 	}
 }
 
+static void sig_show_status(int sig)
+{
+	show_running_run_stats();
+}
+
 static void set_sig_handlers(void)
 {
 	struct sigaction act;
@@ -101,6 +106,11 @@
 	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);
+
 	if (is_backend) {
 		memset(&act, 0, sizeof(act));
 		act.sa_handler = sig_int;