diff options
author | bde <bde@FreeBSD.org> | 2004-05-20 16:42:39 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2004-05-20 16:42:39 +0000 |
commit | 38ad66960391879da6700c4894ec8e49b0f0c640 (patch) | |
tree | d3ffbfe92d2a4d5e0be272814513f66df00a7a3d /sys/kern/subr_prof.c | |
parent | fb7ca181a044eebf4bf95587b8a05c061a1cf69f (diff) | |
download | FreeBSD-src-38ad66960391879da6700c4894ec8e49b0f0c640.zip FreeBSD-src-38ad66960391879da6700c4894ec8e49b0f0c640.tar.gz |
Initialize the history counter type field in struct gmonparam as
threatened in rev.1.10 of usr.sbin/kgmon/kgmon.c more than 2 years ago.
kgmon has been recovering from the missing initialization for too
long, but the fixup there is ifdefed for i386's and shouldn't be
needed for other arches.
Diffstat (limited to 'sys/kern/subr_prof.c')
-rw-r--r-- | sys/kern/subr_prof.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c index 622dea7..ea1c4ab 100644 --- a/sys/kern/subr_prof.c +++ b/sys/kern/subr_prof.c @@ -178,8 +178,12 @@ kmstartup(dummy) p->kcount = (HISTCOUNTER *)cp; cp += p->kcountsize; p->froms = (u_short *)cp; + p->histcounter_type = FUNCTION_ALIGNMENT / HISTFRACTION * NBBY; #ifdef GUPROF + /* Signed counters. */ + p->histcounter_type = -p->histcounter_type; + /* Initialize pointers to overhead counters. */ p->cputime_count = &KCOUNT(p, PC_TO_I(p, cputime)); p->mcount_count = &KCOUNT(p, PC_TO_I(p, mcount)); |