From owner-cvs-all Wed Mar 6 1:47:40 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 0AE0937B404; Wed, 6 Mar 2002 01:47:37 -0800 (PST) Received: (from bde@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g269lb014861; Wed, 6 Mar 2002 01:47:37 -0800 (PST) (envelope-from bde) Message-Id: <200203060947.g269lb014861@freefall.freebsd.org> From: Bruce Evans Date: Wed, 6 Mar 2002 01:47:36 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.bin/gprof gprof.c gprof.h printgprof.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG bde 2002/03/06 01:47:36 PST Modified files: usr.bin/gprof gprof.c gprof.h printgprof.c Log: Fixed some misspellings of 2 as sizeof(UNIT) so that they won't break things when sizeof(UNIT) becomes a runtime parameter. The relevant 2 is the one in profil(2)'s scaling of pc's to bucket numbers: bucket = (pc - offset) / 2 * profil_scale / 65536 gprof(1) must duplicate this scaling, bug for bug compatibly, so it must first do an integer division by 2 although this mainly makes scales larger than 65536 useless. sizeof(UNIT) was already wrong in gprof4, but there were no problems because the fake profil scale is a multiple of 2. There are also some rounding bugs in the scaling, but these are only problems if profil(2) is used directly to create unusual (and not useful) scales. Revision Changes Path 1.15 +10 -10 src/usr.bin/gprof/gprof.c 1.13 +7 -1 src/usr.bin/gprof/gprof.h 1.8 +2 -2 src/usr.bin/gprof/printgprof.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message