summaryrefslogtreecommitdiffstats
path: root/sys/sys/pmckern.h
diff options
context:
space:
mode:
authorjkoshy <jkoshy@FreeBSD.org>2005-06-09 19:45:09 +0000
committerjkoshy <jkoshy@FreeBSD.org>2005-06-09 19:45:09 +0000
commit1d3209ab83aac3089f15e00934e922d222a4ecf0 (patch)
tree4970329c2802c6329dd4f6e781d84b27dbf8f412 /sys/sys/pmckern.h
parent4421a087425df7cc08a5671152d0ec7410bdb33e (diff)
downloadFreeBSD-src-1d3209ab83aac3089f15e00934e922d222a4ecf0.zip
FreeBSD-src-1d3209ab83aac3089f15e00934e922d222a4ecf0.tar.gz
MFP4:
- Implement sampling modes and logging support in hwpmc(4). - Separate MI and MD parts of hwpmc(4) and allow sharing of PMC implementations across different architectures. Add support for P4 (EMT64) style PMCs to the amd64 code. - New pmcstat(8) options: -E (exit time counts) -W (counts every context switch), -R (print log file). - pmc(3) API changes, improve our ability to keep ABI compatibility in the future. Add more 'alias' names for commonly used events. - bug fixes & documentation.
Diffstat (limited to 'sys/sys/pmckern.h')
-rw-r--r--sys/sys/pmckern.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/sys/pmckern.h b/sys/sys/pmckern.h
index 7a222da..5f2e158 100644
--- a/sys/sys/pmckern.h
+++ b/sys/sys/pmckern.h
@@ -44,9 +44,6 @@
#define PMC_FN_CSW_OUT 3
#define PMC_FN_DO_SAMPLES 4
-#define PMC_FN_PROCESS_EXIT 5 /* obsolete */
-#define PMC_FN_PROCESS_FORK 6 /* obsolete */
-
/* hook */
extern int (*pmc_hook)(struct thread *_td, int _function, void *_arg);
extern int (*pmc_intr)(int _cpu, uintptr_t _pc, int _usermode);
@@ -55,7 +52,10 @@ extern int (*pmc_intr)(int _cpu, uintptr_t _pc, int _usermode);
extern struct sx pmc_sx;
/* Per-cpu flags indicating availability of sampling data */
-extern cpumask_t pmc_cpumask;
+extern volatile cpumask_t pmc_cpumask;
+
+/* Count of system-wide sampling PMCs in existence */
+extern volatile int pmc_ss_count;
/* Hook invocation; for use within the kernel */
#define PMC_CALL_HOOK(t, cmd, arg) \
@@ -92,6 +92,8 @@ do { \
(__predict_false(atomic_load_acq_int(&(p)->p_flag) & \
P_HWPMC))
+#define PMC_SYSTEM_SAMPLING_ACTIVE() (pmc_ss_count > 0)
+
/* Check if a CPU has recorded samples. */
#define PMC_CPU_HAS_SAMPLES(C) (__predict_false(pmc_cpumask & (1 << (C))))
OpenPOWER on IntegriCloud