aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1997-02-13 10:47:29 +0000
committerBruce Evans <bde@FreeBSD.org>1997-02-13 10:47:29 +0000
commita7d00b5bf6e6faab2997c47a926bb97fdce0f091 (patch)
tree74327105423fdc4aca556a119eaf1da1dd6f7740 /sys
parent2ff95d56b3d6b5bda033be1f8d1048fdfd7284c7 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/include/profile.h10
-rw-r--r--sys/i386/include/profile.h10
-rw-r--r--sys/sys/gmon.h5
3 files changed, 18 insertions, 7 deletions
diff --git a/sys/amd64/include/profile.h b/sys/amd64/include/profile.h
index 2dc78d9d6c77..3247d1486616 100644
--- a/sys/amd64/include/profile.h
+++ b/sys/amd64/include/profile.h
@@ -39,6 +39,12 @@
#ifdef KERNEL
/*
+ * Config generates something to tell the compiler to align functions on 16
+ * byte boundaries. A strict alignment is good for keeping the tables small.
+ */
+#define FUNCTION_ALIGNMENT 16
+
+/*
* The kernel uses assembler stubs instead of unportable inlines.
* This is mainly to save a little time when profiling is not enabled,
* which is the usual case for the kernel.
@@ -49,7 +55,7 @@
#ifdef GUPROF
#define CALIB_SCALE 1000
#define KCOUNT(p,index) ((p)->kcount[(index) \
- / (HISTFRACTION * sizeof(*(p)->kcount))])
+ / (HISTFRACTION * sizeof(HISTCOUNTER))])
#define MCOUNT_DECL(s)
#define MCOUNT_ENTER(s)
#define MCOUNT_EXIT(s)
@@ -62,6 +68,8 @@
#else /* !KERNEL */
+#define FUNCTION_ALIGNMENT 4
+
#define _MCOUNT_DECL static __inline void _mcount
#define MCOUNT \
diff --git a/sys/i386/include/profile.h b/sys/i386/include/profile.h
index 2dc78d9d6c77..3247d1486616 100644
--- a/sys/i386/include/profile.h
+++ b/sys/i386/include/profile.h
@@ -39,6 +39,12 @@
#ifdef KERNEL
/*
+ * Config generates something to tell the compiler to align functions on 16
+ * byte boundaries. A strict alignment is good for keeping the tables small.
+ */
+#define FUNCTION_ALIGNMENT 16
+
+/*
* The kernel uses assembler stubs instead of unportable inlines.
* This is mainly to save a little time when profiling is not enabled,
* which is the usual case for the kernel.
@@ -49,7 +55,7 @@
#ifdef GUPROF
#define CALIB_SCALE 1000
#define KCOUNT(p,index) ((p)->kcount[(index) \
- / (HISTFRACTION * sizeof(*(p)->kcount))])
+ / (HISTFRACTION * sizeof(HISTCOUNTER))])
#define MCOUNT_DECL(s)
#define MCOUNT_ENTER(s)
#define MCOUNT_EXIT(s)
@@ -62,6 +68,8 @@
#else /* !KERNEL */
+#define FUNCTION_ALIGNMENT 4
+
#define _MCOUNT_DECL static __inline void _mcount
#define MCOUNT \
diff --git a/sys/sys/gmon.h b/sys/sys/gmon.h
index 71bc91069959..9014ecc23b77 100644
--- a/sys/sys/gmon.h
+++ b/sys/sys/gmon.h
@@ -68,12 +68,7 @@ struct gmonhdr {
* addresses, so that each counter belongs to a unique function.
* A lower density of counters would give less resolution but a
* higher density would be wasted.
- *
- * Assume that function addresses are at least 4-byte-aligned.
- * It would be better to get the linker to align functions more
- * strictly so that we could use smaller tables.
*/
-#define FUNCTION_ALIGNMENT 4
#define HISTFRACTION (FUNCTION_ALIGNMENT / sizeof(HISTCOUNTER) == 0 \
? 1 : FUNCTION_ALIGNMENT / sizeof(HISTCOUNTER))