From dac34079f7d8cfb0a64e4d3f086728edd7eded6d Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 17 Oct 2016 14:51:54 -0600 Subject: [PATCH] iolog: enable replay_redirect on iolog replay Signed-off-by: Jens Axboe --- iolog.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iolog.c b/iolog.c index ab9c8788..686c7134 100644 --- a/iolog.c +++ b/iolog.c @@ -346,7 +346,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) unsigned long long offset; unsigned int bytes; int reads, writes, waits, fileno = 0, file_action = 0; /* stupid gcc */ - char *fname, *act; + char *rfname, *fname, *act; char *str, *p; enum fio_ddir rw; @@ -357,7 +357,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) * for doing verifications. */ str = malloc(4096); - fname = malloc(256+16); + rfname = fname = malloc(256+16); act = malloc(256+16); reads = writes = waits = 0; @@ -365,8 +365,12 @@ static int read_iolog2(struct thread_data *td, FILE *f) struct io_piece *ipo; int r; - r = sscanf(p, "%256s %256s %llu %u", fname, act, &offset, + r = sscanf(p, "%256s %256s %llu %u", rfname, act, &offset, &bytes); + + if (td->o.replay_redirect) + fname = td->o.replay_redirect; + if (r == 4) { /* * Check action first @@ -451,7 +455,7 @@ static int read_iolog2(struct thread_data *td, FILE *f) free(str); free(act); - free(fname); + free(rfname); if (writes && read_only) { log_err("fio: <%s> skips replay of %d writes due to" -- 2.25.1