path: root/sys/sys/gmon.h
diff options
authorBruce Evans <bde@FreeBSD.org>2002-02-21 05:52:49 +0000
committerBruce Evans <bde@FreeBSD.org>2002-02-21 05:52:49 +0000
commit2ef41c0cb53cff8e5d4a3b0e73e0105216cd93ac (patch)
tree630078cc80ecef913760120de7f79f329132d84e /sys/sys/gmon.h
parent8c09f6fb1fc17153ec3ab2514950cc12ad3c6506 (diff)
Reserved one of the spare fields in struct gmon to record the history
counter type, as threatened in rev.1.8 (the density doesn't need to be recorded since it can be derived from other fields). This doesn't affect binary compatibility, but new utilities won't be able to depend on the contents of this field because libc/gmon/gmon.c was broken -- it wrote garbage to the spare fields. Added a history counter type field to struct gmonparam. This breaks binary compatibility a little, since kgmon wanted to read the whole struct. Fixed kgmon to only depend on reading the critical earlier parts of the struct. This should also fix 6+ year old breakage of binary compatibility when the profrate field was added. Only initialize the new field in struct gmon for now, so that the compatibility code for this (in kgmon) gets tested. The compatibility code has to guesstimate the value. The new field in struct gmonparam is for the kernel to initialize so that kgmon doesn't have to guess.
Notes: svn path=/head/; revision=91009
Diffstat (limited to 'sys/sys/gmon.h')
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/sys/gmon.h b/sys/sys/gmon.h
index 79434a4888a9..90e4e228e9c3 100644
--- a/sys/sys/gmon.h
+++ b/sys/sys/gmon.h
@@ -48,8 +48,8 @@ struct gmonhdr {
int ncnt; /* size of sample buffer (plus this header) */
int version; /* version number */
int profrate; /* profiling clock rate */
- int spare[3]; /* reserved */
- /* XXX should record counter size and density */
+ int histcounter_type; /* size (in bits) and sign of HISTCOUNTER */
+ int spare[2]; /* reserved */
#define GMONVERSION 0x00051879
@@ -180,6 +180,7 @@ struct gmonparam {
int mexitcount_overhead;
int mexitcount_post_overhead;
int mexitcount_pre_overhead;
+ int histcounter_type;
extern struct gmonparam _gmonparam;