Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2012 18:02:23 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Attilio Rao <attilio@FreeBSD.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, Davide Italiano <davide@FreeBSD.org>, svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin <jhb@FreeBSD.org>
Subject:   Re: svn commit: r238907 - projects/calloutng/sys/kern
Message-ID:  <20120803174624.K1152@besplex.bde.org>
In-Reply-To: <CAJ-FndDLn5w3v_V7vX8Q4vB6J6uJrEAEHEvDd=B9Ezo180%2BMFw@mail.gmail.com>
References:  <201207301350.q6UDobCI099069@svn.freebsd.org> <201207301732.33474.jhb@freebsd.org> <CAJ-FndD5EO12xsWOAe6u0EvX00q33wxO4OivnGjzj0=T2Oe8uA@mail.gmail.com> <201208021707.22356.jhb@freebsd.org> <CAJ-FndDLn5w3v_V7vX8Q4vB6J6uJrEAEHEvDd=B9Ezo180%2BMFw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2 Aug 2012, Attilio Rao wrote:

> On 8/2/12, John Baldwin <jhb@freebsd.org> wrote:
>> On Thursday, August 02, 2012 4:56:03 pm Attilio Rao wrote:
>>> On 7/30/12, John Baldwin <jhb@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120803174624.K1152>