Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Erwan Velu <erwan@seanodes.com>
Cc: fio@vger.kernel.org
Subject: Re: Passing argument to both write_bw_log & write_lat_log leads to segfault
Date: Wed, 19 Nov 2008 16:20:04 +0100	[thread overview]
Message-ID: <20081119152004.GP26308@kernel.dk> (raw)
In-Reply-To: <20081119151534.GO26308@kernel.dk>

On Wed, Nov 19 2008, Jens Axboe wrote:
> On Wed, Nov 19 2008, Erwan Velu wrote:
> > Jens Axboe wrote:
> > 
> > [....]
> > >Wow, you are handy at finding old bugs that nobody has hit :-). The
> > >below should fix it.
> > >  
> > Hehe :p
> > >Generally, fio always wants a '=' to assign a value to a parameter. But
> > >of course the parser should not crash...
> > >  
> > Ok. It that configuration correct ?
> > 
> > [global]
> > bsrange=64k-128k,64k-128k
> > direct=1
> > ioengine=libaio
> > iodepth=64
> > zonesize=256m
> > zoneskip=2g
> > 
> > [/dev/sdb]
> > rw=read
> > write_bw_log=read-bw
> > write_lat_log=read-lat
> > 
> > [/dev/sdb]
> > stonewall
> > rw=write
> > write_bw_log=write-bw
> > write_lat_log=write-lat
> > 
> > If yes, I have a problem because I only have files called : sdb_clat.log 
> > & sdb_slat.log
> 
> They don't accept a parameter. I can rectify that, I guess sometimes
> you'd like that (especially for big jobs). The log should contain
> entries from both, with a direction field.
> 
> Let me double check tonight and make sure it doesn't truncate the log or
> anything like that, I don't think I've ever used the log like this. It
> should just append.

OK, it truncates. This will help. I'll have it accept file names as well
later today.

diff --git a/log.c b/log.c
index 5c468ad..ab457c7 100644
--- a/log.c
+++ b/log.c
@@ -388,7 +388,7 @@ static int init_iolog_write(struct thread_data *td)
 	FILE *f;
 	unsigned int i;
 
-	f = fopen(td->o.write_iolog_file, "w+");
+	f = fopen(td->o.write_iolog_file, "a");
 	if (!f) {
 		perror("fopen write iolog");
 		return 1;
@@ -455,7 +455,7 @@ void __finish_log(struct io_log *log, const char *name)
 	unsigned int i;
 	FILE *f;
 
-	f = fopen(name, "w");
+	f = fopen(name, "a");
 	if (!f) {
 		perror("fopen log");
 		return;

-- 
Jens Axboe


      reply	other threads:[~2008-11-19 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19 11:23 Passing argument to both write_bw_log & write_lat_log leads to segfault Erwan Velu
2008-11-19 11:28 ` Jens Axboe
2008-11-19 15:10   ` Erwan Velu
2008-11-19 15:15     ` Jens Axboe
2008-11-19 15:20       ` Jens Axboe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081119152004.GP26308@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=erwan@seanodes.com \
    --cc=fio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox