[patch] profile enhancements, please read!

From: John Baboval (baboval@mclinux.com)
Date: Wed May 24 2000 - 16:29:56 EST

The attached patch makes the following enhancements to the kernel profiler:

- Dynamic allocation of the profile buffer.

     This allows for profiling on a production system without the continuous
     performance hit that the profiler causes. You can turn it on, get you
     data, and then turn it off again....
     I submitted this as a patch to 2.3.99pre8, but nobody commented, and it
     didn't get applied. I'm resubmitting because the further enhancements
     are impractical without this. Control of the buffer is via a
     /proc/sys/kernel entry 'prof_shift'. you can write the same value to
     this file as you would pass to the profile= parameter at boot time. To
     turn off profiling, write a zero to the file. I have a second
     implementation of this feature as a system call which I feel is
     cleaner, though less practical. Any comments on this matter would be
- Selective profiling by context
     This allows the kernel profiler to only be activated when the context
     matches the constraints specified in the new files
     /proc/sys/kernel/prof_pid and prof_name. The profiler is triggered when
     the value in prof_pid equals the pid, or when the value in prof_name
     matches the comm entry in the task_struct. If prof_name is NULL
     (default) and prof_pid is -1 (default) the profiler acts as usual.
     The benefit of this is being able to see what section of the kernel is
     effecting the particular task you are trying to optimize.
     I also am interested in hearing wether people would like the opposite of
     this, i.e. all processes except one specified.... This would be a
     simple addition. This would be useful for testing with a client and
     server running on the same machine (if this is all you have to work
- Percentage readouts for readprofile

     These aren't included in this patch, as it's not directly kernel
     related. If anyone wants these they can e-mail me. Basically this adds
     a column to the readprofile output that indicates the percentage of
     time spent in each area.

Please review and test/apply this patch.


-John <baboval@missioncriticallinux.com>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/

This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:12 EST