|
Running gprof and gcov
gprof and gcov support in UML is present in CVS as of
17 Apr 2001. I sent it to Alan for inclusion in
the ac tree, and it will be in my 2.4.4 release.
To use gprof with UML, you do the following
-
Configure with gprof support - this is "enable gprof support" under "Kernel
Hacking". You'll need to turn on "kernel debugging symbols" first.
-
Build UML.
-
Boot it up and run your tests in it.
-
Halt it, and the standard gmon.out file will be written out. Run gprof as
you would with any other process
host% gprof linux
and you will get the standard reams of gprof output.
Here is gprof output from
several hours of a thrashing UML. There is some commentary on it in
this entry of
the UML diary.
Using gcov with UML is similar:
-
Configure with gprof support - this is "enable gcov support" under "Kernel
Hacking". You'll need to turn on "kernel debugging symbols" first.
-
Build UML.
-
Boot it up and run your tests in it.
-
Halt UML, and every file in the kernel that has coverage data will get a
'file.da' file. In order to see what coverage of a particular file you
achieved with your tests, run
host% gcov file.c
This will produce 'file.c.gcov', which is 'file.c' annotated with line-by-line
coverage information.
|