[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] How to use valgrind to detect xen hypervisor's memory leak

On Fri, 2011-07-15 at 03:42 +0100, hellokitty wrote:
> Hi all,
>       Thanks to Ian Campbell, I am a student and now i am doing a research
> about using valgrind to detect xen hypervisor's memory leak .
>       The procedure of my detection is as follows:
>       First I follow the patch
> http://xen.1045712.n5.nabble.com/PATCHv2-valgrind-support-for-Xen-privcmd-ioctls-hypercalls-tc2640861.html#a4568310
> to let valgrind support Xen privcmd/hypercall.
>       Second I compile the source code of valgrind (have patched the upper
> patch) 

Please post your modified version of the patch.

>       Third I use the valgrind tool to detect the hypervisor's memory leak .
>       And the issues now i have are as follows:
>       1 , Now i come to second step , and i run the commands to compile the
> source code :

You seem to have missed step 0) which is to regenerate configure and
Makefile.* using autoconf/automake as I described in a previous mail.

>             1)     ./configure --with-xen=/usr/include/xen/
>             2)     make && make install
>             here i encounter the following error messages, how to fix it ?
> --------------------------------------------------------------------------------------
>               gcc: @XEN_CFLAGS@ÃÅÂdoesn't exist the file or directory

The configure script should have substituted this out, but if you didn't
regenerate it after apply the patch then it won't know to do this.

> [...]

> --------------------------------------------------------------------------------------
>       2, Suppose that i come to the third step, is it right to use the command
> to do the detection ?
>         "valgrind --tool=memcheck --leak-check=yes ./xen" (here xen is the
> binary file compiled by the source code of xen_4.0.1)

Wait, are you trying to use valgrind on the hypervisor itself?

The Xen hypervisor is an "Operating System" and runs on bare metal --
you can't run it as a process under Linux and therefore you cannot run a
tool like valgrind on it.

The valgrind support in my patch is useful for debugging the Xen
toolstack (e.g. "xl"), but not the hypervisor itself.

>         3,Does anyone here ever detect the xen hypervisor's memory leak
> before ?  Does someone have the valgrind tool support for hypervisor well ,
> can you send me one ?

Either Valgrind or Xen does not work how you seem to think it works. I
think you should consult with your advisor before trying to progress
this approach any further.

You might want to investigate the Linux kernel's "kmemleak" stuff, I
suppose something like that could be ported to Xen (although I expect it
to be a non-trivial amount of work).


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.