From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 15 13:32:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8576C16A4CE for ; Sun, 15 Feb 2004 13:32:33 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0DDD43D1F for ; Sun, 15 Feb 2004 13:32:32 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id i1FLWUhM016512 for ; Sun, 15 Feb 2004 22:32:31 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: hackers@freebsd.org From: Poul-Henning Kamp Date: Sun, 15 Feb 2004 22:32:30 +0100 Message-ID: <16511.1076880750@critter.freebsd.dk> Subject: Neat little, not so simple project... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2004 21:32:33 -0000 We can compile our kernel with "--test-coverage --profile-arcs" to do basic-block profiling (see kernbb(8) and gcov(1)/gcc(1) docs.) Modify the code GCC inserts, so that it records if giant was held in one bit, and if not held in another, ie: if (giant) *counter_loc |= 1; else *counter_loc |= 2; Run your kernel for a few days. Use kernbb(8) to retrieve output. Produce graphics/statistics showing which code is Giant, which is giant free and which is mixed mode. Consider for instance the "xterm unreadable" font approach, and render the source files into pngs (a 800x660 png holds ten by ten standard pages without margins between) where you color the characters and lines by the result: black - not executed. red - executed with giant always yellow - executed with mixed giant holding green - never executed with giant. Brownie points: Get slashdotted when they discover you did it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.