From owner-svn-src-projects@FreeBSD.ORG Fri Aug 3 08:02:33 2012 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5C101065670; Fri, 3 Aug 2012 08:02:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by mx1.freebsd.org (Postfix) with ESMTP id 66EA78FC17; Fri, 3 Aug 2012 08:02:32 +0000 (UTC) Received: from c122-106-171-246.carlnfd1.nsw.optusnet.com.au (c122-106-171-246.carlnfd1.nsw.optusnet.com.au [122.106.171.246]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q7382NOv012002 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Aug 2012 18:02:24 +1000 Date: Fri, 3 Aug 2012 18:02:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Attilio Rao In-Reply-To: Message-ID: <20120803174624.K1152@besplex.bde.org> References: <201207301350.q6UDobCI099069@svn.freebsd.org> <201207301732.33474.jhb@freebsd.org> <201208021707.22356.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Konstantin Belousov , Davide Italiano , svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r238907 - projects/calloutng/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Aug 2012 08:02:33 -0000 On Thu, 2 Aug 2012, Attilio Rao wrote: > On 8/2/12, John Baldwin wrote: >> On Thursday, August 02, 2012 4:56:03 pm Attilio Rao wrote: >>> On 7/30/12, John Baldwin wrote: > ... >>>> --- //depot/projects/smpng/sys/sys/cpuset.h 2012-03-25 >>>> 18:45:29.000000000 >>>> 0000 >>>> +++ //depot/user/jhb/lock/sys/cpuset.h 2012-06-18 21:20:58.000000000 >>>> 0000 >>>> @@ -216,6 +216,9 @@ >>>> int cpusetobj_ffs(const cpuset_t *); >>>> char *cpusetobj_strprint(char *, const cpuset_t *); >>>> int cpusetobj_strscan(cpuset_t *, const char *); >>>> +#ifdef DDB >>>> +void ddb_display_cpuset(const cpuset_t *); >>>> +#endif >>>> >>>> #else >>>> __BEGIN_DECLS >>> >>> I'd prefer you offer a compat stub in order to avoid a KPI breakage >>> rather than make an header dependent by DDB. If it was INVARIANTS >>> dependant you may have user INVARIANT_SUPPORT for this, but I guess we >>> just use that for INVARIANTS and not DDB (even if we could generalize >>> it to, maybe under another name, to all the debugging mechanisms). Always add bloat if possible. >> Humm. Do we do that anywhere else for DDB (provide empty shims)? I think >> you already can't use a module that depends on DDB if the kernel doesn't >> have >> DDB enabled (no db_printf() for example), so I don't think this introduces >> any >> new KPI breakage. Headers can't depend on options. Elsewhere we often declare functions whose existence might depend on options unconditionally, to avoid the ifdef tangles and header dependencies that would be needed to declare them precisely when they exist. The above foot shooting uses a simple tangle and 1 dependency (on not having the style bug of including opt_ddb.h after cpuset.h. This style bug is easy to avoid by the convention of sorting all options headers before all other headers, but due to namespace pollution, including opt_ddb.h before sys/cpuset.h is not enough. sys/cpuset.h is included nested in at least smp.h and sysproto.h, despite the existence of sys/_cpuset.h to reduce the pollution). > I think it is sensitive we don't add further KPI breakage. I think it > is a good time we start discussing expansion of INVARIANT_SUPPORT to > something more general that offers compat shims for all the debugging > mechanisms. Then it would be so large and complicated that it would include and #include almost everything, but still be harder to use correctly than it is now. Bruce