Kernel Profiling???? Please explain...

DPD (dpd@asan.com)
Sun, 3 Nov 1996 10:57:53 -0500


Hello!

(Please send all flames and destructive remarks to /dev/null...I'll
get to those later...Thanks!)

I've been reading these mail articles about 'kernel profile(s)',
however:
>
> On Sat, 2 Nov 1996, Linus Torvalds wrote:
>
> >
> > Ok, anybody want to profile their kernel? It's really pretty
> > simple:
> >
> > - boot the kernel with the "profile=2" kernel command line (you
> > can use
> > a line like
> > append = "profile=2"
> > in your lilo.conf if you use LILO).
I use 'make bzImage', if I append 'profile=2' into my 'LOADLIN'
command line will it work the same???

> >
> > - make sure you have the System.map file that corresponds to your
> > kernel
> > in your root directory (this should be done automatically for
> > you if you use "make zlilo" to create the kernel)
How can I assure that I have the proper 'System.map' file???

> >
> > - do a "echo > /proc/profile" as root before starting x11perf to
> > clear
> > out any old profiling information
Sentence completion: Kernel profiling is used to.....

> >
> > - run x11perf and afterwards parse the profile information with
> > the supplied
> > program. The output is very easy to decipher..
Hmmmm....can someone explain to me what the output means??

> >
> > I'd be interested to hear what the results are, and the anomaly
> > _should_ show up pretty clearly.
> >
> > Linus
>
> I had to make the following change to the program:
>
> --- profile.c.orig Sat Nov 2 21:11:16 1996
> +++ profile.c Sat Nov 2 21:11:37 1996
> @@ -104,7 +104,7 @@
> fscanf(kmap, "%x %*s %s\n", &next_symbol_value, next_symbol);
> continue;
> }
> - lseek (fp , sizeof(unsigned int)+current_symbol_value-0xc0100000
> , SEEK_SET); + lseek (fp , sizeof(unsigned
> int)+current_symbol_value-0x00100000 , SEEK_SET);
> has_read = read (fp , buffer , sizeof(buffer) );
> for ( j = 0 ; j < has_read/sizeof(unsigned int) ; j++) {
> if (!strcmp(func, current_symbol))
I have patched my kernel from 2.0.22 to 2.0.24, if necessary, how do
I implement/patch the above "patch" into my current kernel???

>
> With kernel 2.0.23 I had the following results:
>
> 1 0.10% 001104e0 do_page_fault
> 1 0.10% 0011a110 partial_clear
> 1 0.10% 0011a5c0 handle_mm_fault
> 1 0.10% 00124920 grow_files
> 1 0.10% 0012e930 file_ioctl
> 1 0.10% 0012eea0 free_wait
> 1 0.10% 0012f240 _set_fd_set
> 1 0.10% 001382a0 sock_release
<snip>
> 927 100.00% 00000000 total
>
Can someone enlighten me as to understanding what this output really means??

Where can I find more information/documentation about 'kernel
profiling'?

Thanks for your help!

Dom