Date: Thu, 17 Oct 1996 12:32:35 -0700 (PDT) From: Bruce Evans <bde> To: CVS-committers, cvs-all, cvs-sys Subject: cvs commit: src/sys/i386/isa prof_machdep.c src/sys/kern subr_prof.c src/sys/i386/conf files.i386 options.i386 src/sys/i386/include profile.h src/sys/libkern mcount.c src/sys/sys gmon.h Message-ID: <199610171932.MAA24163@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
bde 96/10/17 12:32:33
Modified: sys/i386/conf files.i386 options.i386
sys/i386/include profile.h
sys/i386/isa prof_machdep.c
sys/kern subr_prof.c
sys/libkern mcount.c
sys/sys gmon.h
Log:
Improved non-statistical (GUPROF) profiling:
- use a more accurate and more efficient method of compensating for
overheads. The old method counted too much time against leaf
functions.
- normally use the Pentium timestamp counter if available.
On Pentiums, the times are now accurate to within a couple of cpu
clock cycles per function call in the (unlikely) event that there
are no cache misses in or caused by the profiling code.
- optionally use an arbitrary Pentium event counter if available.
- optionally regress to using the i8254 counter.
- scaled the i8254 counter by a factor of 128. Now the i8254 counters
overflow slightly faster than the TSC counters for a 150MHz Pentium :-)
(after about 16 seconds). This is to avoid fractional overheads.
files.i386:
permon.c temporarily has to be classified as a profiling-routine
because a couple of functions in it may be called from profiling code.
options.i386:
- I586_CTR_GUPROF is currently unused (oops).
- I586_PMC_GUPROF should be something like 0x70000 to enable (but not
use unless prof_machdep.c is changed) support for Pentium event
counters. 7 is a control mode and the counter number 0 is somewhere
in the 0000 bits (see perfmon.h for the encoding).
profile.h:
- added declarations.
- cleaned up separation of user mode declarations.
prof_machdep.c:
Mostly clock-select changes. The default clock can be changed by
editing kmem. There should be a sysctl for this.
subr_prof.c:
- added copyright.
- calibrate overheads for the new method.
- documented new method.
- fixed races and and machine dependencies in start/stop code.
mcount.c:
Use the new overhead compensation method.
gmon.h:
- changed GPROF4 counter type from unsigned to int. Oops, this should
be machine-dependent and/or int32_t.
- reorganized overhead counters.
Submitted by: Pentium event counter changes mostly by wollman
Revision Changes Path
1.141 +2 -1 src/sys/i386/conf/files.i386
1.24 +3 -1 src/sys/i386/conf/options.i386
1.8 +31 -5 src/sys/i386/include/profile.h
1.3 +154 -14 src/sys/i386/isa/prof_machdep.c
1.17 +149 -37 src/sys/kern/subr_prof.c
1.9 +58 -72 src/sys/libkern/mcount.c
1.9 +10 -15 src/sys/sys/gmon.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610171932.MAA24163>
