From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 2 17:23:18 2009 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 D4AA01065687; Mon, 2 Feb 2009 17:23:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id A5B5E8FC1E; Mon, 2 Feb 2009 17:23:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n12HNHo5067728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Feb 2009 09:23:18 -0800 (PST) (envelope-from sam@freebsd.org) Message-ID: <49872C05.9010302@freebsd.org> Date: Mon, 02 Feb 2009 09:23:17 -0800 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: Matthew Fleming References: <1233337318.13748.101.camel@amaretto> <1233339897.13748.106.camel@amaretto> <200902020846.33072.jhb@freebsd.org> <1233591461.7789.25.camel@amaretto> In-Reply-To: <1233591461.7789.25.camel@amaretto> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: freebsd-hackers@freebsd.org Subject: Re: Dynamic ddb commands 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: Mon, 02 Feb 2009 17:23:19 -0000 Matthew Fleming wrote: >> In general it is far easier to just add sysinit's than to hack directly on the >> kernel linker. There are very few ddb commands, so one extra pointer or two >> per command is not a lot of space. >> > > Respectfully, I disagree, for several reasons. > > First, in order to make sysinit and sysctl work, the kernel linker > needed to know that there are a set of elf sections that have special > meaning. Yes, using sysinits means that there are still only two elf > sections of interest. > > Second, as I mentioned before, having ddb commands added mixed in with > sysinits means that, if I have a bug in my sysinit I may not be able to > use some of my ddb commands to debug it. Even if DB_*COMMAND used > SI_ORDER_FIRST, any sysinit with the same priority may come first. > > Next, if you want commands sorted globally, it could be done with either > implementation. But I think that commands that are defined by a module > should be listed with others from that module. > > Last, changing struct command introduces a binary compatibility issue. > Any older driver that had a ddb command (even if they never realized > they couldn't access it) would need to be recompiled. I am not sure of > FreeBSD's binary compatibility policy, though, and it would presumably > be across a major OS revision number. So this is not a very compelling > argument. > I'm not sure I buy any of these arguments (well maybe the 2nd one :)) but I'm still open to your changes. I just haven't had time to look at your patch; hope to this week (I have several other patches in my q for review ahead of yours). Sam