From owner-freebsd-audit Fri Aug 10 21:50: 9 2001 Delivered-To: freebsd-audit@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id 7472137B405 for ; Fri, 10 Aug 2001 21:50:06 -0700 (PDT) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id WAA75695; Fri, 10 Aug 2001 22:50:03 -0600 (MDT) (envelope-from ken) Date: Fri, 10 Aug 2001 22:50:03 -0600 From: "Kenneth D. Merry" To: "Sergey A. Osokin" Cc: audit@FreeBSD.ORG Subject: Re: [PATCH] libdevstat have two compute statistics functions Message-ID: <20010810225003.B75606@panzer.kdm.org> References: <20010808184710.A87195@freebsd.org.ru> <20010809102140.A62588@panzer.kdm.org> <20010810161632.A7827@freebsd.org.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20010810161632.A7827@freebsd.org.ru>; from osa@freebsd.org.ru on Fri, Aug 10, 2001 at 04:16:32PM +0400 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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