On Sun, Jan 11, 2004 at 10:21:43AM -0600, Glen Overby wrote:
> On January 11, Andi Kleen wrote:
> > I found many of the XFS include files hard to read because
> > of XFS_WANTS_FUNCS. What use is that define? Is it still used
> > for anything? Would patches to remove it have a chance to be
> > accepted?
>
> When we build XFS kernels with the DEBUG define set, it turns those
> macros into C functions (see xfs_macros.c). This is so stack traces
> will show what macro a problem occurs inside of, and so breakpoints
> can be set inside of macros.
It sounds like inline functions would serve your goal better. When
you have a kernel with debug information you can see exactly
the line the fault occurs in then. You could even define the "inline" away
to them them into normal static functions, although that would probably
not be too useful (except maybe for KDB). They would also be a lot more
type safe. You can also still set breakpoints in the, although only
per file, not global.
I can do a patch to convert them to inlines if there are chances that
it will get merged.
-Andi
|