Date: Tue, 8 Nov 2011 20:52:34 -0500 From: Arnaud Lacombe <lacombar@gmail.com> To: Julian Elischer <julian@freebsd.org> Cc: freebsd-current@freebsd.org Subject: Re: Using Instruction Pointer address in debug interfaces [Was: Re: vm_page_t related KBI [Was: Re: panic at vm_page_wire with FreeBSD 9.0 Beta 3]] Message-ID: <CACqU3MWkcKZ2cjh_VJueWUpOS7dzhu%2BMh8yYWVA8X9B9ykOW7w@mail.gmail.com> In-Reply-To: <4EB9C469.9070208@freebsd.org> References: <CACqU3MU_Bk%2BcObCiUa2XtM7fLkSpSDzOZqoZ=khNOR-_6ptYYQ@mail.gmail.com> <4EB9C469.9070208@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, On Tue, Nov 8, 2011 at 7:08 PM, Julian Elischer <julian@freebsd.org> wrote: > On 11/8/11 10:49 AM, Arnaud Lacombe wrote: >> >> Hi, >> To avoid future complaints about the fact that I would be only "talk" >> without "action", I did implement what I suggested above. As it is >> quite a large patch-set, I will not post it directly here, however, it >> is available on github: >> >> https://github.com/lacombar/freebsd/tree/master/topic/kern-lock-debug >> >> It convert a bunch of debug interface to use the caller instruction >> pointer, as well as a proof-of-concept teaching printf(9) to convert >> IP to symbol_name+offset. >> >> It translates in a direct saving of about +250kB on i386's GENERIC, >> just in kernel text size. Even the worst case, ie LOCK_DEBUG == 0, >> translates to a save of +80kB. >> >> Please note that this is still WIP code. > > A couple of comments. > Firstly, the idea of a printf method to print the IP as symbol+offset is an > interesting idea > that should be followed up in its own right. > FWIW, I have no credit in this idea. It has been in Linux for ages and ages. That said, IP address are barely used in FreeBSD, there is no legacy. As such, the API should not use `unsigned long' but `void *'[0]; this is the natural type returned by `__builtin_return_address()' and the `&&' operator. This would allow to introduce a modifier to `%p' to do the translation. - Arnaud ps: netgraph is on my target list, as well as the list code, to some extend :) [0]: as I really hate `caddr_t'
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MWkcKZ2cjh_VJueWUpOS7dzhu%2BMh8yYWVA8X9B9ykOW7w>