From owner-svn-src-stable-11@freebsd.org Wed May 24 11:10:57 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E815D7A7E3; Wed, 24 May 2017 11:10:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF971AB7; Wed, 24 May 2017 11:10:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4OBAulR068656; Wed, 24 May 2017 11:10:56 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4OBAujr068655; Wed, 24 May 2017 11:10:56 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201705241110.v4OBAujr068655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 24 May 2017 11:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r318783 - stable/11/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2017 11:10:57 -0000 Author: avg Date: Wed May 24 11:10:55 2017 New Revision: 318783 URL: https://svnweb.freebsd.org/changeset/base/318783 Log: MFC r316853: dtrace: fix normalization of stddev aggregation Sponsored by: Panzura Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Wed May 24 11:09:06 2017 (r318782) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c Wed May 24 11:10:55 2017 (r318783) @@ -389,8 +389,10 @@ dt_stddev(uint64_t *data, uint64_t norma * The standard approximation for standard deviation is * sqrt(average(x**2) - average(x)**2), i.e. the square root * of the average of the squares minus the square of the average. + * When normalizing, we should divide the sum of x**2 by normal**2. */ dt_divide_128(data + 2, normal, avg_of_squares); + dt_divide_128(avg_of_squares, normal, avg_of_squares); dt_divide_128(avg_of_squares, data[0], avg_of_squares); norm_avg = (int64_t)data[1] / (int64_t)normal / (int64_t)data[0];