From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH 5 of 6] xen: sched_sedf: beautify statisics in SEDF Date: Tue, 23 Oct 2012 18:33:43 +0200 Message-ID: <1351010023.5064.63.camel@Solace> References: <27c4c065efe366a5d761.1350916838@Solace> <5086C544.4070607@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6115728464639850279==" Return-path: In-Reply-To: <5086C544.4070607@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Paul Durrant , "Keir (Xen.org)" , Jan Beulich , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============6115728464639850279== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-pP/uXTKgcwDsWIH0GN5b" --=-pP/uXTKgcwDsWIH0GN5b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2012-10-23 at 17:26 +0100, George Dunlap wrote: > On 22/10/12 15:40, Dario Faggioli wrote: > > By gathering all the related fields in a struct (as it is being done > > in credit) and using the macros we now have available. No functional > > changes involved. > > > > Signed-off-by: Dario Faggioli >=20 > I'm OK with this as it is, but... >=20 Ok. > > #ifdef SEDF_STATS > > - if ( EDOM_INFO(d)->block_time_tot !=3D 0 ) > > - printk(" pen=3D%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot *= 100) / > > - EDOM_INFO(d)->block_time_tot); > > - if ( EDOM_INFO(d)->block_tot !=3D 0 ) > > + if ( EDOM_INFO(d)->stats.block_time_tot !=3D 0 ) > > + printk(" pen=3D%"PRIu64"%%", (EDOM_INFO(d)->stats.penalty_time= _tot * 100) / > > + EDOM_INFO(d)->stats.block_time_tot); > > + if ( EDOM_INFO(d)->stats.block_tot !=3D 0 ) > > printk("\n blks=3D%u sh=3D%u (%u%%) (shc=3D%u (%u%%) shex= =3D%i "\ > > "shexsl=3D%i) l=3D%u (%u%%) avg: b=3D%"PRIu64" p=3D%"P= RIu64"", > > - EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot, > > - (EDOM_INFO(d)->short_block_tot * 100) > > - / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont, > > - (EDOM_INFO(d)->short_cont * 100) / EDOM_INFO(d)->block_= tot, > > - EDOM_INFO(d)->pen_extra_blocks, > > - EDOM_INFO(d)->pen_extra_slices, > > - EDOM_INFO(d)->long_block_tot, > > - (EDOM_INFO(d)->long_block_tot * 100) / EDOM_INFO(d)->bl= ock_tot, > > - (EDOM_INFO(d)->block_time_tot) / EDOM_INFO(d)->block_to= t, > > - (EDOM_INFO(d)->penalty_time_tot) / EDOM_INFO(d)->block_= tot); > > + EDOM_INFO(d)->stats.block_tot, EDOM_INFO(d)->stats.shor= t_block_tot, > > + (EDOM_INFO(d)->stats.short_block_tot * 100) > > + / EDOM_INFO(d)->stats.block_tot, EDOM_INFO(d)->stats.sh= ort_cont, > > + (EDOM_INFO(d)->stats.short_cont * 100) / EDOM_INFO(d)->= stats.block_tot, > > + EDOM_INFO(d)->stats.pen_extra_blocks, > > + EDOM_INFO(d)->stats.pen_extra_slices, > > + EDOM_INFO(d)->stats.long_block_tot, > > + (EDOM_INFO(d)->stats.long_block_tot * 100) / EDOM_INFO(= d)->stats.block_tot, > > + (EDOM_INFO(d)->stats.block_time_tot) / EDOM_INFO(d)->st= ats.block_tot, > > + (EDOM_INFO(d)->stats.penalty_time_tot) / EDOM_INFO(d)->= stats.block_tot); >=20 > ...wouldn't it be even more beautiful to have a macro for reading stats= =20 > as well? >=20 > Like I said, it's fine as it is, but since you're looking for beauty, I= =20 > figured I'd point it out. :-) >=20 I see what you mean. Again, as you wish. This code will need some (and quite a bit actually) of attention as soon as I or someone else get the time to work on it. If you're fine about taking this as is, I'll make a note to self about the macro (as I agree it would be nice). OTOH, if you prefer me to repost the patch, I think I can find 5 mins to hack it up... Thanks and Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-pP/uXTKgcwDsWIH0GN5b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAlCGxucACgkQk4XaBE3IOsQM6wCfVlCKXgH2+U6Lxwbt8/f+vrBL SrcAoKkiiqsV7YsUWDp+js6dQfhZuhlm =ZrA9 -----END PGP SIGNATURE----- --=-pP/uXTKgcwDsWIH0GN5b-- --===============6115728464639850279== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6115728464639850279==--