diff options
author | bde <bde@FreeBSD.org> | 1996-10-17 19:32:31 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-10-17 19:32:31 +0000 |
commit | a0f16401c5c8aa8537932ccc296e9253fca3debd (patch) | |
tree | 2f3c01bb1684b82e42c63c0a17d658ba5ded662b /sys/sys/gmon.h | |
parent | d0d507caa9d6718e7f6699bae600f120362f59b7 (diff) | |
download | FreeBSD-src-a0f16401c5c8aa8537932ccc296e9253fca3debd.zip FreeBSD-src-a0f16401c5c8aa8537932ccc296e9253fca3debd.tar.gz |
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
Diffstat (limited to 'sys/sys/gmon.h')
-rw-r--r-- | sys/sys/gmon.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sys/sys/gmon.h b/sys/sys/gmon.h index 619e94c..6d5334c 100644 --- a/sys/sys/gmon.h +++ b/sys/sys/gmon.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)gmon.h 8.2 (Berkeley) 1/4/94 - * $Id: gmon.h,v 1.7 1995/08/29 03:09:14 bde Exp $ + * $Id: gmon.h,v 1.8 1995/12/29 15:29:26 bde Exp $ */ #ifndef _SYS_GMON_H_ @@ -57,7 +57,7 @@ struct gmonhdr { * Type of histogram counters used in the kernel. */ #ifdef GPROF4 -#define HISTCOUNTER unsigned +#define HISTCOUNTER int #else #define HISTCOUNTER unsigned short #endif @@ -174,22 +174,17 @@ struct gmonparam { fptrint_t highpc; u_long textsize; u_long hashfraction; - u_long profrate; + int profrate; /* XXX wrong type to match gmonhdr */ HISTCOUNTER *cputime_count; - u_int cputime_overhead; - u_int cputime_overhead_frac; - u_int cputime_overhead_resid; - u_int cputime_overhead_sub; + int cputime_overhead; HISTCOUNTER *mcount_count; - u_int mcount_overhead; - u_int mcount_overhead_frac; - u_int mcount_overhead_resid; - u_int mcount_overhead_sub; + int mcount_overhead; + int mcount_post_overhead; + int mcount_pre_overhead; HISTCOUNTER *mexitcount_count; - u_int mexitcount_overhead; - u_int mexitcount_overhead_frac; - u_int mexitcount_overhead_resid; - u_int mexitcount_overhead_sub; + int mexitcount_overhead; + int mexitcount_post_overhead; + int mexitcount_pre_overhead; }; extern struct gmonparam _gmonparam; |