Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Apr 2008 14:37:17 +0200
From:      "Antoine Brodin" <antoine@FreeBSD.org>
To:        Volker <volker@vwsoft.com>
Cc:        hackers@freebsd.org
Subject:   Re: "visualize" kernel memory allocations
Message-ID:  <f19c444a0804150537t11378638w998c1716dd7750cc@mail.gmail.com>
In-Reply-To: <4803AE07.9010106@vwsoft.com>
References:  <4803AE07.9010106@vwsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 14, 2008 at 9:18 PM, Volker <volker@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).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f19c444a0804150537t11378638w998c1716dd7750cc>