From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 24 20:01:26 2008 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 2E3E81065682 for ; Sun, 24 Aug 2008 20:01:26 +0000 (UTC) (envelope-from gballet@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by mx1.freebsd.org (Postfix) with ESMTP id BDF228FC1A for ; Sun, 24 Aug 2008 20:01:25 +0000 (UTC) (envelope-from gballet@gmail.com) Received: by ug-out-1314.google.com with SMTP id o4so393800uge.39 for ; Sun, 24 Aug 2008 13:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Av/2WGPySz6VOqjibD5CYLSubKEIRZRlUsunFtGryyQ=; b=wSjMrOPAcYV4q0CEHX6WoufwFEB/XnZXRp5FxfARC16JXXFJNIitG1gjw0mzVtPbgT 4/md3uqpcJn4vGFMQcPHugIorUaLf1/g2hMiol/drG+N+onjU6vSMMFJVPx2dgiW4f7/ cKGyOHbpDyVeuR57FuirGq4STqxeHMZTk/5mM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=NJcvCoVflsVKg41Es8czOkob2BdM7out9Oy/ptwQ3dm1dAw8R2YjjKzcxPhD7gz3pG RMUK5V29XdZdS11mElYdbpZSiIqb4zoQgr+M/BxhVKKmFcAFFTUGxqJqzATn2OMx26wx dJEKEj83BxlK9oca1sNfxx4zVaB9dvq91s/9U= Received: by 10.187.230.4 with SMTP id h4mr289799far.12.1219608084150; Sun, 24 Aug 2008 13:01:24 -0700 (PDT) Received: by 10.187.247.12 with HTTP; Sun, 24 Aug 2008 13:01:24 -0700 (PDT) Message-ID: Date: Sun, 24 Aug 2008 20:01:24 +0000 From: "Guillaume Ballet" To: freebsd-hackers@freebsd.org In-Reply-To: <200808181002.14885.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48A70B37.60401@freebsd.org> <200808181002.14885.jhb@freebsd.org> Cc: Sam Leffler Subject: Re: Extending the ddb command set 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: Sun, 24 Aug 2008 20:01:26 -0000 On Mon, Aug 18, 2008 at 2:02 PM, John Baldwin wrote: > (snip) > A simpler approach is probably to make DB_COMMAND() use a SYSINIT to register > new functions instead of teaching DDB about that linker set. You just need > to write a shared "register_command()" function (and a deregister for > SYSUNINIT for module unload) that the SYSINIT uses. This also probably > requires changing the structure of the DDB tables, though you might be able > to make it simpler now. You could probably just make the tables be sorted > linked lists now instead of arrays. This would also remove the whole "aux > table" hack. > Following Sam and John's advice, I have rewritten the patch so as to use SYS(UN)INIT. It uses a linked list instead of an array to store commands. As the patch is more than 400 lines long, it is available for reviewing at: http://dl.free.fr/jQQQkB72h0 I used 7.0 ; 6.2 requires a bit more work. Many thanks to Sam, John and Kostik for their suggestions. Feedback is still welcome :)