Re: [RFC] hwbkpt: Hardware breakpoints (was Kwatch)
From: Christoph Hellwig
Date: Mon Mar 05 2007 - 08:37:05 EST
On Sun, Mar 04, 2007 at 11:01:36PM -0800, Roland McGrath wrote:
> > The parts relating to kernel breakpoints could be made conditional
> > on a Kconfig option. The amount of code space saved would be
> > relatively small; I'm not sure that it would be worthwhile.
>
> In a utrace merge, the user parts can be made conditional on CONFIG_UTRACE.
> Then with both turned off, the code goes away completely. It's unlikely it
> will ever be turned off, but it is a clean way to go about things in case
> someone wants the smallest possible config for a limited-use installation.
Making this unconditional is pointless and just makes things harder to
read, so please don't do it. (The same is true for utrace, but Roland
has unfortunately still not replied to my mail mentioning it :P)
> > + void (*installed)(struct hwbkpt *);
> > + void (*uninstalled)(struct hwbkpt *);
>
> Save space in the struct by having just one function for both installed
> and uninstalled, taking an argument. Probably a caller should be able to
> pass a null function here to say that the registration call should fail if
> it can't be installed due to higher-priority or no-callback registrations
> existing, and that its registration cannot be ejected by another (i.e., an
> ill-behaved user).
Please not. That might save a few bytes, but it makes the interface a
lot harder to understand for users. We really discourage over-loaded
interfaces in Linux.
> > +struct thread_hwbkpt { /* HW breakpoint info for a thread */
Can this and all the file names please get an actually readable name?
E.g. hw_breakpoint. We're not IBM managers that needs to save every
cent on superflous sillables :)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/