From owner-freebsd-hackers@FreeBSD.ORG Wed Mar 2 12:56:45 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A23B106566B for ; Wed, 2 Mar 2011 12:56:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6C27C8FC17 for ; Wed, 2 Mar 2011 12:56:45 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1318A46B90; Wed, 2 Mar 2011 07:56:45 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9B8A48A01B; Wed, 2 Mar 2011 07:56:44 -0500 (EST) From: John Baldwin To: Carl Date: Tue, 1 Mar 2011 17:13:40 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <4D6C78D3.5090803@telus.net> <201103010800.35666.jhb@freebsd.org> <4D6D50AC.701@telus.net> In-Reply-To: <4D6D50AC.701@telus.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103011713.40140.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 02 Mar 2011 07:56:44 -0500 (EST) Cc: freebsd-hackers@freebsd.org Subject: Re: listing all modules compiled into a kernel instance X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2011 12:56:45 -0000 On Tuesday, March 01, 2011 3:01:48 pm Carl wrote: > On 2011-03-01 3:20 AM, Maxim Khitrov wrote: > > kldstat provides information about components that were loaded > > dynamically. If your kernel was built with INCLUDE_CONFIG_FILE option > > (enabled by default in GENERIC), then you can see the static > > components using: > > > > config -x /boot/kernel/kernel > > As has been shown though, "kldstat -v" actually does show static > components, at least those declared with DRIVER_MODULE(), and "config > -x" does not improve on the situation at all because components like > ucom were not cited in the configuration file. IMHO, there needs to be a > reliable way to query an existing kernel that yields a _complete_ list > of which components are actually included. > > On 2011-03-01 5:00 AM, John Baldwin wrote: > >> Maybe ucom doesn't appear because it doesn't have a DRIVER_MODULE() > >> declaration (because it isn't a driver). > > > > Yes, that would explain it. > > I can explicitly include ucom in a kernel by adding "device ucom" in the > configuration file, in which case it would call DRIVER_MODULE(), right? > That would then make it appear in the "kldstat -v" list? So why is it a > driver when it's done explicitly, but not a driver when done implicitly? > That makes no sense to me since the functionality doesn't change. IMHO, > this is a bug that needs to be fixed, not just for ucom but any > implicitly included driver. No, the _source_ code of device ucom has to explicitly say "I am a module named 'foo'" using a DECLARE_MODULE() macro (or another macro such as DRIVER_MODULE() that invokes DECLARE_MODULE()). The 'device ucom' in a config file does not generate this, that is just an instruction that config(8) uses when looking in sys/conf/files to see which C source files to include in the kernel build. -- John Baldwin