Lines Matching full:pmc
58 * example, when support for a new PMC type is added.
77 * some way for PMC operations. CPU names are grouped by manufacturer
81 * Please keep the pmc(3) manual page in sync with this list.
167 * A PMC can be in the following states:
176 * holds the number of CPUs using this PMC at
206 * An allocated PMC may used as a 'global' counter or as a
208 * statistical sampling mode or in counting mode. Thus a PMC in use
215 * Statistical profiling modes rely on the PMC periodically delivering
217 * been measured), so the PMC must have the ability to generate
220 * In counting modes, the PMC counts its configured events, with the
221 * value of the PMC being read whenever needed by its owner process.
256 * PMC row disposition
286 __PMC_CAP(READ, 5, "read PMC counter") \
287 __PMC_CAP(WRITE, 6, "reprogram PMC counter") \
307 * PMC Event Numbers
321 * PMC SYSCALL INTERFACE
334 __PMC_OP(GETPMCINFO, "Get per-cpu PMC information") \
335 __PMC_OP(PMCADMIN, "Set PMC state") \
336 __PMC_OP(PMCALLOCATE, "Allocate and configure a PMC") \
337 __PMC_OP(PMCATTACH, "Attach a PMC to a process") \
338 __PMC_OP(PMCDETACH, "Detach a PMC from a process") \
339 __PMC_OP(PMCGETMSR, "Get a PMC's hardware address") \
340 __PMC_OP(PMCRELEASE, "Release a PMC") \
341 __PMC_OP(PMCRW, "Read/Set a PMC") \
343 __PMC_OP(PMCSTART, "Start a PMC") \
344 __PMC_OP(PMCSTOP, "Stop a PMC") \
397 * PMC IDs have the following format:
400 * | CPU | PMC MODE | CLASS | ROW INDEX |
405 * process-mode PMCs. Field 'PMC MODE' is the allocated PMC mode.
406 * Field 'PMC CLASS' is the class of the PMC. Field 'ROW INDEX' is the
407 * row index for the PMC.
422 * Data structures for system calls supported by the pmc driver.
428 * Allocate a PMC on the named CPU.
436 enum pmc_class pm_class; /* class of PMC desired */
440 pmc_id_t pm_pmcid; /* [return] process pmc id */
450 * a PMC 'pm_pmc' on CPU 'pm_cpu'. Note that 'pm_pmc' specifies an
451 * absolute PMC number and need not have been first allocated by the
458 int pm_pmc; /* PMC# */
465 * Attach/detach a PMC and a process.
469 pmc_id_t pm_pmc; /* PMC to attach to */
482 pmc_id_t pm_pmcid; /* PMC id to set */
488 * Read the value of a PMC named by 'pm_pmcid'. 'pm_pmcid' needs
494 pmc_id_t pm_pmcid; /* pmc id */
501 * retrieve PMC state for a named CPU. The caller is expected to
507 char pm_name[PMC_NAME_MAX]; /* pmc name */
532 uint32_t pm_width; /* width of the PMC */
558 * Retrieve pmc(4) driver-wide statistics.
591 * Simple operations on a PMC id.
612 * PMC. This number can be used subsequently with a read-performance-counter
618 pmc_id_t pm_pmcid; /* allocated pmc id */
624 * Retrieve a PMC dynamic class events list.
667 * PMC commands
683 * PMC description.
689 enum pmc_class pd_class; /* class of the PMC */
697 * PMC.
706 * struct pmc
708 * Describes each allocated PMC.
710 * Each PMC has precisely one owner, namely the process that allocated
711 * the PMC.
713 * A PMC may be attached to multiple target processes. The
715 * by this PMC.
720 * process-virtual PMC could be concurrently executing on different
722 * the PMC gets scheduled on a CPU and atomically decremented when it
723 * get descheduled. Deletion of a PMC is only permitted when this
732 struct pmc { struct
734 LIST_ENTRY(pmc) pm_next; /* owner's list */
738 * around. For system-wide PMCs we record the CPU the PMC was
739 * allocated on in the 'CPU' field of the pmc ID.
743 * their current PMC counter values when they are taken off
752 * For sampling mode PMCs, we keep track of the PMC's "reload
754 * arming the PMC for the next counting session. For counting
761 pmc_value_t pm_reloadcount; /* sampling PMC modes */
762 pmc_value_t pm_initial; /* counting PMC modes */
766 volatile cpuset_t pm_cpustate; /* CPUs where PMC should be active */
767 uint32_t pm_caps; /* PMC capabilities */
772 enum pmc_state pm_state; /* current PMC state */
775 * The PMC ID field encodes the row-index for the PMC, its
776 * mode, class and the CPU# associated with the PMC.
779 pmc_id_t pm_id; /* allocated PMC id */
787 * Accessor macros for 'struct pmc' argument
798 * Record per-PMC, per-thread state.
812 struct pmc_threadpmcstate pt_pmcs[]; /* per-PMC state */
822 * is associated with NHWPMC 'struct pmc *' pointers. Each PMC at a
824 * array. The size of this structure is thus PMC architecture
830 struct pmc *pp_pmc; /* target PMC */
849 * We associate a PMC with an 'owner' process.
860 CK_LIST_ENTRY(pmc_owner) po_ssnext; /* (g/p) list of SS PMC owners */
861 LIST_HEAD(, pmc) po_pmcs; /* owned PMC list */
879 * struct pmc_hw -- describe the state of the PMC hardware
881 * When in use, a HW PMC is associated with one allocated 'struct pmc'
884 * On an SMP box, one or more HW PMC's in process virtual mode with
888 * 'struct pmc'. The 'phw_save' field is used to keep the saved PMC
892 * pmc' at context switch time).
898 struct pmc *phw_pmc; /* current thread PMC */
936 struct pmc *ps_pmc; /* interrupting PMC */
999 * PMC class-dependent operations.
1005 int pcd_ri; /* row index of the first PMC in class */
1006 int pcd_width; /* width of the PMC */
1009 int (*pcd_config_pmc)(int _cpu, int _ri, struct pmc *_pm);
1010 int (*pcd_get_config)(int _cpu, int _ri, struct pmc **_ppm);
1011 int (*pcd_read_pmc)(int _cpu, int _ri, struct pmc *_pm,
1013 int (*pcd_write_pmc)(int _cpu, int _ri, struct pmc *_pm,
1016 /* pmc allocation/release */
1017 int (*pcd_allocate_pmc)(int _cpu, int _ri, struct pmc *_t,
1019 int (*pcd_release_pmc)(int _cpu, int _ri, struct pmc *_pm);
1022 int (*pcd_start_pmc)(int _cpu, int _ri, struct pmc *_pm);
1023 int (*pcd_stop_pmc)(int _cpu, int _ri, struct pmc *_pm);
1027 struct pmc **_ppmc);
1046 uint32_t pmd_nclass; /* number of PMC classes present */
1056 /* handle a PMC interrupt */
1060 * PMC class dependent information.
1148 #define PMC_DEBUG_MAJ_PMC 6 /* pmc management */
1182 /* PMC */
1183 #define PMC_DEBUG_MIN_REG 8 /* pmc register */
1226 int pmc_process_interrupt(int _ring, struct pmc *_pm, struct trapframe *_tf);