From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from brick.kernel.dk ([93.163.65.50]:51961 "EHLO kernel.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbZHAIXk (ORCPT ); Sat, 1 Aug 2009 04:23:40 -0400 Date: Sat, 1 Aug 2009 10:23:40 +0200 From: Jens Axboe Subject: Re: problem with the "write_bw_log" parameter in a virtualized environment using a write iopattern Message-ID: <20090801082340.GZ12579@kernel.dk> References: <4A72AF0E.7070005@seanodes.com> <20090731092127.GO12579@kernel.dk> <4A73107B.8030102@seanodes.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <4A73107B.8030102@seanodes.com> Sender: fio-owner@vger.kernel.org List-Id: fio@vger.kernel.org To: Ivan Frain Cc: fio@vger.kernel.org On Fri, Jul 31 2009, Ivan Frain wrote: > Jens Axboe a =EF=BF=BDcrit : >> On Fri, Jul 31 2009, Ivan Frain wrote: >> =20 >>> Hi everybody, >>> >>> I'am using fio in a vmware virtualized environment. I have got a guest >>> virtual machine based on centos5.2 on which I run fio in order to >>> measure the virtual disks IO performances. >>> I use the "write_bw_log" parameter in order to build graphs for the >>> experiments but the problem is that the file generated by fio for each >>> job is empty (size =3D 0). >>> However, i also use "write_clat_log" parameter and the 'clat.log' and >>> 'slat.log' files are not empty. The mean bandwidth in the fio output >>> summary seams to be good. >>> =20 >> >> I wonder how long that bug has been there... It's due to a botched >> memcpy in the fio core. There are two stat sample times, yet it >> overwrites only the first one (being 0, or DDIR_READ, which explains why >> the read one works). >> >> Try the below patch, it's also committed now. >> >> diff --git a/fio.c b/fio.c >> index ba9e384..7ad1b57 100644 >> --- a/fio.c >> +++ b/fio.c >> @@ -1105,7 +1105,10 @@ static void *thread_main(void *data) >> clear_state =3D 0; >> while (keep_running(td)) { >> fio_gettime(&td->start, NULL); >> - memcpy(&td->ts.stat_sample_time, &td->start, sizeof(td->start)); >> + memcpy(&td->ts.stat_sample_time[0], &td->start, >> + sizeof(td->start)); >> + memcpy(&td->ts.stat_sample_time[1], &td->start, >> + sizeof(td->start)); >> memcpy(&td->tv_cache, &td->start, sizeof(td->start)); >> if (td->o.ratemin[0] || td->o.ratemin[1]) >> >> =20 > > Well, this patch works very well, the bw log file is filled again. > Thank you for your quick answer. Good! > FIO rocks !! Thanks :-) --=20 Jens Axboe