Lines Matching +full:system +full:- +full:wide
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2003-2008, Joseph Koshy
48 #define PMC_CLASS_MAX 8 /* max #classes of PMCs per-system */
51 * Kernel<->userland API version number [MMmmpppp]
170 * DISABLED -- administratively prohibited from being used.
171 * FREE -- HW available for use
173 * ALLOCATED -- allocated
174 * STOPPED -- allocated, but not counting events
175 * RUNNING -- allocated, and in operation; 'pm_runcount'
178 * DELETED -- being destroyed
207 * 'thread-private' one. Each such mode of use can be in either
210 * SS i.e., SYSTEM STATISTICAL -- system-wide statistical profiling
211 * SC i.e., SYSTEM COUNTER -- system-wide counting mode
212 * TS i.e., THREAD STATISTICAL -- thread virtual, statistical profiling
213 * TC i.e., THREAD COUNTER -- thread virtual, counting mode
223 * The thread specific modes "virtualize" the PMCs -- the PMCs appear
227 * The system-wide "global" modes keep the PMCs running all the time
228 * and are used to measure the behaviour of the whole system.
262 __PMC_DISP(THREAD) /* thread-virtual PMCs */ \
282 __PMC_CAP(USER, 1, "count user-mode events") \
283 __PMC_CAP(SYSTEM, 2, "count system-mode events") \
293 __PMC_CAP(SYSWIDE, 12, "system wide counter") \
294 __PMC_CAP(DOMWIDE, 13, "NUMA domain wide counter")
315 #define __PMC_EV_BLOCK(C,V) PMC_EV_ ## C ## __BLOCK_START = (V) - 1 ,
325 * "PMC_OPS" -- these are the commands recognized by the kernel
326 * module, and are used when performing a system call from userland.
331 __PMC_OP(GETCPUINFO, "Get system CPU information") \
334 __PMC_OP(GETPMCINFO, "Get per-cpu PMC information") \
375 * through class-dependent fields
399 * +-----------------------+-------+-----------+
401 * +-----------------------+-------+-----------+
404 * is set to the requested CPU for system-wide PMCs or PMC_CPU_ANY for
405 * process-mode PMCs. Field 'PMC MODE' is the allocated PMC mode.
422 * Data structures for system calls supported by the pmc driver.
511 pid_t pm_ownerpid; /* owner, or -1 */
526 * Retrieve system CPU information.
547 * Configure a log file for writing system-wide statistics to.
552 int pm_logfd; /* logfile fd (or -1) */
558 * Retrieve pmc(4) driver-wide statistics.
612 * PMC. This number can be used subsequently with a read-performance-counter
659 * (b) - pmc_bufferlist_mtx (spin lock)
660 * (k) - pmc_kthread_mtx (sleep lock)
661 * (o) - po->po_mtx (spin lock)
662 * (g) - global_epoch_preempt (epoch)
663 * (p) - pmc_sx (sx)
719 * On a multi-cpu machine, multiple target threads associated with a
720 * process-virtual PMC could be concurrently executing on different
737 * System-wide PMCs are allocated on a CPU and are not moved
738 * around. For system-wide PMCs we record the CPU the PMC was
755 * modes on PMCs that are read-only (e.g., the x86 TSC), we
757 * counting-mode operation.
775 * The PMC ID field encodes the row-index for the PMC, its
790 #define PMC_TO_MODE(P) PMC_ID_TO_MODE((P)->pm_id)
791 #define PMC_TO_CLASS(P) PMC_ID_TO_CLASS((P)->pm_id)
792 #define PMC_TO_ROWINDEX(P) PMC_ID_TO_ROWINDEX((P)->pm_id)
793 #define PMC_TO_CPU(P) PMC_ID_TO_CPU((P)->pm_id)
798 * Record per-PMC, per-thread state.
801 pmc_value_t pt_pmcval; /* per-thread reload count */
812 struct pmc_threadpmcstate pt_pmcs[]; /* per-PMC state */
823 * given hardware row-index 'n' will use slot 'n' of the 'pp_pmcs[]'
831 pmc_value_t pp_pmcval; /* per-process value */
852 * lifetime, where NCPUS is the numbers of CPUS in the system and
879 * struct pmc_hw -- describe the state of the PMC hardware
932 pid_t ps_pid; /* process PID or -1 */
952 (&(psb)->ps_samples[(psb)->ps_considx & pmc_sample_mask])
955 (&(psb)->ps_samples[(off) & pmc_sample_mask])
958 (&(psb)->ps_samples[(psb)->ps_prodidx & pmc_sample_mask])
999 * PMC class-dependent operations.
1029 /* class-dependent initialization & finalization */
1033 /* machine-specific interface */
1066 * Per-CPU state. This is an array of 'mp_ncpu' pointers
1077 /* HWPMC_DEBUG without KTR will compile but is a no-op. */
1079 #error "HWPMC_DEBUG requires KTR and KTR_COMPILE=KTR_SUBSYS -- see ktr(4)"