"visualize" kernel memory allocations

Antoine Brodin antoine at FreeBSD.org
Tue Apr 15 13:05:51 UTC 2008


On Mon, Apr 14, 2008 at 9:18 PM, Volker <volker at vwsoft.com> wrote:
> Hi hackers!
>
>  I need to hunt kernel memory allocations done by a kld. Unfortunately
>  the kld in question is a blob, no access to source code, so I need to
>  check for kmem_alloc() + kmem_malloc() + kmem_free() and print
>  information from there to the console screen.

Hi Volker,

You could patch your kld (hexadecimal editor or something like that)
to call wrappers around the interesting functions that print the
arguments.
I hope this helps.

Cheers,

Antoine

>  >From within these functions, I need to get the name (or an ID) of the
>  module trying to allocate memory (and display that or - better - filter
>  some allocations out).


More information about the freebsd-hackers mailing list