Re: fio-1.2 writing bw_log

From: Jens Axboe <jens.axboe_at_oracle.com>
Date: Wed, 7 May 2008 14:42:08 +0200

On Sat, May 03 2008, Jens Axboe wrote:
> On Thu, May 01 2008, walter harms wrote:
> > hi list,
> > i was playing with fio-1.2 and was unable to write my bw_log.
> >
> > what i did:
> >
> > 1. removed the [/dev/sdb] from examples/disk-zone-profile and renamed it disk-zone-profile.2
> > 2. i run
> > ./fio --name="/dev/sdc" examples/disk-zone-profile.2
> > with long options --write_bw_log with short options -w or -b etc. no success at all
> > also the disk-zone-profile.2 contained the option write_bw_log no change.
> >
> > after i switched the internal variable in init.c to 1 the files was written.
>
> I'll take a look at this on monday, thanks!

A little later than expected... Does it work with this patch? Seems the
change to properly prefix the logs with the job name is somehwat
confusing, as it'll end up writing the log in /dev/sdc_bw.log for this
case. This patch brings back more sane behaviour, it'll be stored in
./sdc_bw.log instead.

diff --git a/log.c b/log.c
index 15de3c2..790d3a1 100644
--- a/log.c
+++ b/log.c
@@ -465,8 +465,9 @@ void __finish_log(struct io_log *log, const char *name)
 
 void finish_log(struct thread_data *td, struct io_log *log, const char *name)
 {
- char file_name[256];
+ char file_name[256], *p;
 
         snprintf(file_name, 200, "%s_%s.log", td->o.name, name);
- __finish_log(log, file_name);
+ p = basename(file_name);
+ __finish_log(log, p);
 }

-- 
Jens Axboe
Received on Wed May 07 2008 - 14:42:08 CEST

This archive was generated by hypermail 2.2.0 : Wed May 07 2008 - 15:00:03 CEST