PROFILING(7) FreeBSD Miscellaneous Information Manual PROFILING(7) NAME profiling - kernel profiling under FreeBSD WHAT IS PROFILING? Profiling is a technique to determine how much time a routine or part of a routine consumes. It can help in analysing: o Why some routine perform's poorly, i.e. if it needs a rewrite or a cleanup, thus improving execution speed. o If a routine is not being called more or less than your expec- tation. This information can be useful to fix bugs that are hard to notice. Kernel profiling can help in optimizing or fixing bugs in a particular subsystem. There are various methods of profiling code, but only two are discussed in this manual page: Execution Profiling A method of accounting the running time of called routines in the running time that called them. [1] This technique can be used to com- pare implementations of a particular routine / subsystem, or to tune the amount of CPU time spent. Basic Block Profiling A method of accounting how many times a basic block in a program (part of the kernel in our case) has executed. Basic blocks are series of program instructions which do not perform external opera- tions, thus providing us with an accurate account of how many times each of the instructions were executed. This technique is also known as block counting. EXECUTION PROFILING TODO. Add info on what execution profiling is actually good for; how to use it in FreeBSD, and stuff like that. BASIC BLOCK PROFILING Provide brief description, and information on what bb profiling is good for; how to use it on FreeBSD ( information provided by phk@ ) TODO Using the profil(2) interface Simple introduction to gprof(1) and kgmon(8) Using kernbb(8) HISTORY section SEE ALSO gprof(1), kgmon(8), kernbb(8), profil(2) [grahan82gprof] - "gprof: a Call Graph Execution Profiler" by Susan L. Graham and Peter B. Kessler and Marshall K. McKusick. (1982) AUTHORS This manual page is written by Hiten Pandya and Poul-Henning Kemp. FreeBSD 5.0 December, 6, 2003 FreeBSD 5.0