aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/gmon.h
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2004-05-19 15:41:26 +0000
committerBruce Evans <bde@FreeBSD.org>2004-05-19 15:41:26 +0000
commitb2321e7cdbba8fd1af2fd1c30242753d5c6d93c7 (patch)
treecf3f3f9c7355143e263b31af5e429443de31dd41 /sys/sys/gmon.h
parent5ad6c3b1eaef315edd7c73241a27ae2dddb71edf (diff)
downloadsrc-b2321e7cdbba8fd1af2fd1c30242753d5c6d93c7.tar.gz
src-b2321e7cdbba8fd1af2fd1c30242753d5c6d93c7.zip
Moved most of the "MI" definitions and declarations from <machine/profile.h>
to <sys/gmon.h>. Cleaned them up a little by not attempting to ifdef for incomplete and out of date support for GUPROF in userland, as in the sparc64 version.
Notes
Notes: svn path=/head/; revision=129444
Diffstat (limited to 'sys/sys/gmon.h')
-rw-r--r--sys/sys/gmon.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/sys/gmon.h b/sys/sys/gmon.h
index 003e19c42a03..0b2e2352dc09 100644
--- a/sys/sys/gmon.h
+++ b/sys/sys/gmon.h
@@ -198,4 +198,36 @@ extern struct gmonparam _gmonparam;
#define GPROF_TOS 3 /* struct: destination/count structure */
#define GPROF_GMONPARAM 4 /* struct: profiling parameters (see above) */
+#ifdef _KERNEL
+
+#ifdef GUPROF
+
+#define CALIB_SCALE 1000
+#define KCOUNT(p,index) \
+ ((p)->kcount[(index) / (HISTFRACTION * sizeof(HISTCOUNTER))])
+#define PC_TO_I(p, pc) ((uintfptr_t)(pc) - (uintfptr_t)(p)->lowpc)
+
+extern int cputime_bias;
+
+int cputime(void);
+void nullfunc_loop_profiled(void);
+void nullfunc_profiled(void);
+void startguprof(struct gmonparam *p);
+void stopguprof(struct gmonparam *p);
+
+#else /* !GUPROF */
+
+#define startguprof(p)
+#define stopguprof(p)
+
+#endif /* GUPROF */
+
+void empty_loop(void);
+void kmupetext(uintfptr_t nhighpc);
+void mexitcount(uintfptr_t selfpc);
+void nullfunc(void);
+void nullfunc_loop(void);
+
+#endif /* _KERNEL */
+
#endif /* !_SYS_GMON_H_ */