1 .\" Copyright (c) 1984 M. K. McKusick
2 .\" Copyright (c) 1984 The Regents of the University of California.
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by the University of
16 .\" California, Berkeley and its contributors.
17 .\" 4. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" @(#)0.t 1.2 (Berkeley) 11/8/90
40 Using gprof to Tune the 4.2BSD Kernel
42 Marshall Kirk McKusick
44 Computer Systems Research Group
45 Computer Science Division
46 Department of Electrical Engineering and Computer Science
47 University of California, Berkeley
48 Berkeley, California 94720
50 This paper describes how the \fIgprof\fP profiler
51 accounts for the running time of called routines
52 in the running time of the routines that call them.
53 It then explains how to configure a profiling kernel on
54 the 4.2 Berkeley Software Distribution of
58 \(dd VAX is a trademark of Digital Equipment Corporation.
60 and discusses tradeoffs in techniques for collecting
62 \fIGprof\fP identifies problems
63 that severely affects the overall performance of the kernel.
64 Once a potential problem areas is identified
65 benchmark programs are devised to highlight the bottleneck.
66 These benchmarks verify that the problem exist and provide
67 a metric against which to validate proposed solutions.
68 Two caches are added to the kernel to alleviate the bottleneck
69 and \fIgprof\fP is used to validates their effectiveness.
76 .tl '\\*(LH'\\*(CH'\\*(RH'
80 .ds LH 4.2BSD Performance
83 .if t .ds CF May 21, 1984
87 .B "TABLE OF CONTENTS"
95 .B "2. The \fIgprof\fP Profiler"
96 \0.1. Data Presentation"
97 \0.1.1. The Flat Profile
98 \0.1.2. The Call Graph Profile
99 \0.2 Profiling the Kernel
103 .B "3. Using \fIgprof\fP to Improve Performance
104 \0.1. Using the Profiler
105 \0.2. An Example of Tuning
121 .if t .ta .6i 2.1i 2.6i
122 .\" 2.94 went to 2.6, 3.64 to 3.30
123 .if n .ta .84i 2.6i 3.30i
126 .if t .ta .5i 1.25i 2.5i
127 .\" 3.5i went to 3.8i
128 .if n .ta .7i 1.75i 3.8i