Date: Fri, 10 Aug 2001 22:50:03 -0600 From: "Kenneth D. Merry" <ken@kdm.org> To: "Sergey A. Osokin" <osa@freebsd.org.ru> Cc: audit@FreeBSD.ORG Subject: Re: [PATCH] libdevstat have two compute statistics functions Message-ID: <20010810225003.B75606@panzer.kdm.org> In-Reply-To: <20010810161632.A7827@freebsd.org.ru>; from osa@freebsd.org.ru on Fri, Aug 10, 2001 at 04:16:32PM %2B0400 References: <20010808184710.A87195@freebsd.org.ru> <20010809102140.A62588@panzer.kdm.org> <20010810161632.A7827@freebsd.org.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 10, 2001 at 16:16:32 +0400, Sergey A. Osokin wrote: > On Thu, Aug 09, 2001 at 10:21:40AM -0600, Kenneth D. Merry wrote: > > On Wed, Aug 08, 2001 at 18:47:11 +0400, Sergey A. Osokin wrote: > > > Hello. > > > After last commit into libdevstat, devstat.c containes > > > 2 compute statistics functions: old compute_stats() and > > > new devstat_compute_statistics(). > > > > > > I believe that compute_stats() is not necessary any more > > > and we should remove it. devstat_compute_statistics() is > > > a superset for compute_stats(). > > > > This patch won't work. The reason is that the arguments to compute_stats() > > can be NULL, which will cause it not to calculate that particular > > statistic. > > OK. I mistake about goto's in switch(devstat_arg_list[metric].argtype). > Look at attached patch. I make a little hack for > devstat_compute_statistics(). After this patch function try to > resolve all pairs of parameters. You cut out the part of my message where I discussed, indirectly, this approach: > > Your patch passes in all of the arguments to devstat_compute_statistics(). > > If one of the initial arguments is NULL, it will bail out and not compute > > the rest of the statistics. IMO this is the correct behavior -- the user > > has specified a statistic to calculate, and if he has not also given a > > valid variable to put the result in, that is an error. The problem with this patch is that you can now supply bogus arguments. I don't think that's the right approach. My preference is to leave things as-is. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010810225003.B75606>