rand: print out random seeds for debugging
authorVincent Fu <vincent.fu@samsung.com>
Tue, 21 Feb 2023 22:53:00 +0000 (22:53 +0000)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 13 Apr 2023 17:33:00 +0000 (13:33 -0400)
In order to debug how we handle random seeds let's print out the random
seeds we use in the FD_RANDOM debug output.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
init.c

diff --git a/init.c b/init.c
index a70f749ac3416a12552a46f7b00dbcbdfb41422a..1c8df1a754c576dd558a999dccffd05abc82fdf9 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1111,6 +1111,10 @@ void td_fill_rand_seeds(struct thread_data *td)
 
        init_rand_seed(&td->buf_state, td->rand_seeds[FIO_RAND_BUF_OFF], use64);
        frand_copy(&td->buf_state_prev, &td->buf_state);
+
+       dprint(FD_RANDOM, "FIO_RAND_NR_OFFS=%d\n", FIO_RAND_NR_OFFS);
+       for (int i = 0; i < FIO_RAND_NR_OFFS; i++)
+               dprint(FD_RANDOM, "rand_seeds[%d]=%" PRIu64 "\n", i, td->rand_seeds[i]);
 }
 
 /*