X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=blktrace.c;h=1b9bf3b8452c51a40612917179d00977dc231513;hb=629f1d7150b142d146f8a3ee3cf0a08d1843ca2e;hp=9ce4ae29c8cbe358c4ce0913e84d407721d13c17;hpb=d1c46c049cfba2028abc45246e2609bcee52d0f3;p=fio.git diff --git a/blktrace.c b/blktrace.c index 9ce4ae29..1b9bf3b8 100644 --- a/blktrace.c +++ b/blktrace.c @@ -115,7 +115,7 @@ static int lookup_device(struct thread_data *td, char *path, unsigned int maj, if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, "..")) continue; - sprintf(full_path, "%s/%s", path, dir->d_name); + sprintf(full_path, "%s%s%s", path, FIO_OS_PATH_SEPARATOR, dir->d_name); if (lstat(full_path, &st) == -1) { perror("lstat"); break; @@ -168,6 +168,7 @@ static void trace_add_open_event(struct thread_data *td, int fileno) struct io_piece *ipo; ipo = calloc(1, sizeof(*ipo)); + init_ipo(ipo); ipo->ddir = DDIR_INVAL; ipo->fileno = fileno; @@ -215,8 +216,8 @@ static void store_ipo(struct thread_data *td, unsigned long long offset, { struct io_piece *ipo = malloc(sizeof(*ipo)); - memset(ipo, 0, sizeof(*ipo)); - INIT_FLIST_HEAD(&ipo->list); + init_ipo(ipo); + /* * the 512 is wrong here, it should be the hardware sector size... */ @@ -256,6 +257,7 @@ static void handle_trace_discard(struct thread_data *td, struct blk_io_trace *t, { struct io_piece *ipo = malloc(sizeof(*ipo)); + init_ipo(ipo); trace_add_file(td, t->device); ios[DDIR_WRITE]++;