svn commit: r234400 - in head/sys: kern sys

Bruce Evans brde at optusnet.com.au
Wed Apr 18 04:29:49 UTC 2012


On Tue, 17 Apr 2012, Kirk McKusick wrote:

> Log:
>  Drop export of vdestroy() function from kern/vfs_subr.c as it is
>  used only as a helper function in that file. Replace sole call to
>  vbusy() with inline code in vholdl(). Replace sole calls to vfree()
>  and vdestroy() with inline code in vdropl().
>
>  The Clang compiler already inlines these functions, so they do not
>  show up in a kernel backtrace which is confusing. Also you cannot
>  set their frame in kgdb which means that it is impossible to view
>  their local variables. So, while the produced code is unchanged,
>  the debugging should be easier.

gcc-4.2.1 has the same bug, but you can avoid it using
-fno-inline-functions-called-once (not the default).  Unfortunately,
this flag is not even a no-op with clang (it generates an error message).

Inlining of functions called once also breaks profiling.

The breakage for debugging is especially large for primitive debuggers
like ddb.  Without line numbers, it is difficult to even find the code
for small functions when they are inlined into big functions.   With
full symbol table info, it should be possible to display inlined functions
as if they weren't inlined, especially if they aren't declared inline,
but I've never seen a debugger than can even step over them properly
using 'n'.

Bruce


More information about the svn-src-head mailing list