summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/pmc_mdep.h
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2005-05-01 14:11:49 +0000
committerjkoshy <jkoshy@FreeBSD.org>2005-05-01 14:11:49 +0000
commita21392e3accd60fd407365553a29a3b7250316cc (patch)
tree1e7573a97fa735d4770310305b9ec83d8767f4a7 /sys/i386/include/pmc_mdep.h
parent88ecd82ce992dc5add7c7c4e8a56fd3c6fed65a3 (diff)
downloadFreeBSD-src-a21392e3accd60fd407365553a29a3b7250316cc.zip
FreeBSD-src-a21392e3accd60fd407365553a29a3b7250316cc.tar.gz
Add convenience APIs pmc_width() and pmc_capabilities() to -lpmc.
Have pmcstat(8) and pmccontrol(8) use these APIs. Return PMC class-related constants (PMC widths and capabilities) with the OP GETCPUINFO call leaving OP PMCINFO to return only the dynamic information associated with a PMC (i.e., whether enabled, owner pid, reload count etc.). Allow pmc_read() (i.e., OPS PMCRW) on active self-attached PMCs to get upto-date values from hardware since we can guarantee that the hardware is running the correct PMC at the time of the call. Bug fixes: - (x86 class processors) Fix a bug that prevented an RDPMC instruction from being recognized as permitted till after the attached process had context switched out and back in again after a pmc_start() call. Tighten the rules for using RDPMC class instructions: a GETMSR OP is now allowed only after an OP ATTACH has been done by the PMC's owner to itself. OP GETMSR is not allowed for PMCs that track descendants, for PMCs attached to processes other than their owner processes. - (P4/HTT processors only) Fix a bug that caused the MI and MD layers to get out of sync. Add a new MD operation 'get_config()' as part of this fix. - Allow multiple system-mode PMCs at the same row-index but on different CPUs to be allocated. - Reject allocation of an administratively disabled PMC. Misc. code cleanups and refactoring. Improve a few comments.
Diffstat (limited to 'sys/i386/include/pmc_mdep.h')
-rw-r--r--sys/i386/include/pmc_mdep.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/i386/include/pmc_mdep.h b/sys/i386/include/pmc_mdep.h
index 8b25e1e..e66fe4e 100644
--- a/sys/i386/include/pmc_mdep.h
+++ b/sys/i386/include/pmc_mdep.h
@@ -126,6 +126,9 @@
#define P4_CCCR_MSR_FIRST 0x360 /* MSR_BPU_CCCR0 */
#define P4_PERFCTR_MSR_FIRST 0x300 /* MSR_BPU_COUNTER0 */
+#define P4_RELOAD_COUNT_TO_PERFCTR_VALUE(V) (1 - (V))
+#define P4_PERFCTR_VALUE_TO_RELOAD_COUNT(P) (1 - (P))
+
/* Intel PPro, Celeron, P-II, P-III, Pentium-M PMCS */
#define P6_NPMCS 3 /* 1 TSC + 2 PMCs */
OpenPOWER on IntegriCloud