From owner-freebsd-current@FreeBSD.ORG Mon Sep 15 15:27:20 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E007F53B for ; Mon, 15 Sep 2014 15:27:20 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8186187 for ; Mon, 15 Sep 2014 15:27:20 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A7EE6B97E; Mon, 15 Sep 2014 11:27:19 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: Driver-specific debugging in buildkernel? Date: Mon, 15 Sep 2014 10:55:04 -0400 Message-ID: <2511769.1PR7xqNJql@ralph.baldwin.cx> User-Agent: KMail/4.10.5 (FreeBSD/10.0-STABLE; KDE/4.10.5; amd64; ; ) In-Reply-To: <516095.49108.bm@smtp112.sbc.mail.bf1.yahoo.com> References: <516095.49108.bm@smtp112.sbc.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 15 Sep 2014 11:27:19 -0400 (EDT) Cc: Thomas Mueller X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2014 15:27:21 -0000 On Sunday, September 14, 2014 07:56:16 PM Thomas Mueller wrote: > I want to build a kernel with debugging for a specific device, rather than > for everything. > > Device of interest is re (Ethernet driver), also rsu (USB wlan adapter). > > I looked in Makefiles, also NOTES files, found some xxxxDEBUG options but > nothing really general that could be applied to any desired device in > kernel or module. > > Then I would need to know how to find this debugging information. There isn't a generic "debugging for driver X" knob. You can enable global debugging (e.g. INVARIANTS). Some drivers may have their own internal knobs, but most drivers depend on the global knobs. If you are debugging a driver as a module, you can build the kernel with INVARIANT_SUPPORT and just the driver with INVARIANTS. However, drivers invariably make calls into other subsystems in the kernel and that setup will not include checking for driver misbehavior in its interfacing with those subsystems, so I would generally recommend just enabling INVARIANTS globally. -- John Baldwin