PMDAPERFEVENT(1)
π PMDAPERFEVENT(1) π
okay bestie, gather round, because today we're talking about pmdaperfevent β a Performance Metrics Domain Agent (PMDA for short, say it with me) from the Performance Co-Pilot manual pages, section 1, general commands. she's a little niche, she's a little powerful, and she is literally here to read your hardware performance counters. no cap. π₯
β¨ NAME β¨
pmdaperfevent β hardware performance counter performance metrics domain agent (PMDA). yes that's a mouthful, no we're not changing it, it's iconic. π
π¦ SYNOPSIS π¦
$PCP_PMDAS_DIR/perfevent/pmdaperfevent [-d domain] [-l logfile] [-U username] [-i port] [-p] [-u socket] [-6]
πΈ DESCRIPTION πΈ
okay so pmdaperfevent is a Performance Metrics Domain Agent (PMDA) that configures and reads the hardware performance counters using the Linux kernel perf_event API. that's the whole job. that's the vibe. π
the perfevent PMDA exports metrics for hardware performance counters that are configurable from the Linux kernel perf_event API. it uses the libpfm4 library to get at those hardware performance counters, so basically any counter that libpfm4 supports should be available to you. slay.
also included (bonus content, we love her): the ability to read the Intel RAPL counters via direct MSR access. β¨
the PMDA supports automatically loading different counters for each hardware architecture. a single configuration file is used to specify the desired counters for each hardware performance monitoring unit (PMU). that config file lets you program different counters on different CPUs, and it supports round-robin assignment of uncore counters β which, fun fact, some AMD chips need. π§
the PMDA also counts events exposed in the kernel via the /sys/bus/event_source/devices directory. heads up though: the PMU device name and the event name must both be mentioned in the configuration file. otherwise the metric just won't be available to monitor through this PMDA. no config, no metric, that's the rule fr fr.
here's the tea though π« β the PMDA configures the counters to count events in <b>both user and kernel mode</b>. what does that mean for you? it means when the PMDA is using those hardware counters, normal unprivileged user applications can't use them. but don't panic, she's not mean! the PMDA provides a mechanism to temporarily disable the system-wide counters so regular users can grab the counters if they want. see perfalloc(1) for the deets. π
not me reminding you thatpmdaperfeventis affected by the value of thekernel.perf_event_paranoidsetting β which you can adjust withsysctl(8). just so you know. π
a brief description of the pmdaperfevent command line options follows (and yes, we're doing all of them, every single one, because we don't skip):
-dβ the performance metrics domain number. and bestie, it is absolutely crucial that this number is unique and consistent. meaning: domain should be different for every PMDA on the one host, and the same domain number should be used for the same PMDA on all hosts. do not freestyle this. π¨-lβ location of the log file. by default, a log file namedperfevent.loggets written in the current directory ofpmcd(1)whenpmdaperfeventis started, i.e.$PCP_LOG_DIR/pmcd. if the log file can't be created or isn't writable, output goes to standard error instead. she'll find a way to talk to you. π¬-Uβ user account under which to run the agent. the default is the privileged"root"account. yes, root. she's powerful like that. π-iβ listen on given port number for connection frompmcd(1)-pβ communicate withpmcd(1)via stdin/stdout-uβ expectpmcd(1)to connect on given unix domain socket-6β expectpmcd(1)to connect on given ipv6 port (number or name)
π INSTALLATION π
plot twist: the perfevent PMDA is <b>not activated by default</b>. (i know. tragic.) to install the PMDA, do the following as root:
# cd $PCP_PMDAS_DIR/perfevent
# ./Install
and if you want to undo the installation (we've all been there), do the following as root:
# cd $PCP_PMDAS_DIR/perfevent
# ./Remove
pmdaperfevent is launched by pmcd(1) and should never be executed directly. like, ever. the Install and Remove scripts notify pmcd(1) when the agent is installed or removed, so they've got the whole thing handled. let them cook. π
π FILES π
$PCP_PMCDCONF_PATHβ command line options used to launchpmdaperfevent$PCP_PMDAS_DIR/perfevent/perfevent.confβ default configuration file for the PMDA. seeperfevent.conf(5)for detailed information.$PCP_PMDAS_DIR/perfevent/helpβ default help text file for theperfeventmetrics$PCP_PMDAS_DIR/perfevent/Installβ installation script for thepmdaperfeventagent$PCP_PMDAS_DIR/perfevent/Removeβ undo installation script for thepmdaperfeventagent$PCP_LOG_DIR/pmcd/perfevent.logβ default log file for error messages and other information frompmdaperfevent
β UPGRADING β
okay so some metric names <b>changed starting in version 3.10.8</b> to better conform to PMNS conventions. (glow up era β¨) you can use pmlogrewrite(1) to update old archives. and there's a helper utility β $PCP_PMDAS_DIR/perfevent/perfevent-makerewrite.pl β that will generate a config file suitable for use with pmlogrewrite(1) to update the metric names in existing archives. she's got your back on the migration. π«Ά
π BUGS π
okay, the one thing we gotta be honest about: each event is placed in its own group, and there is no way to group related events together so they're guaranteed to be simultaneously active. π
a workaround for this is to ensure that the number of configured events is less than or equal to the number of available hardware counters. that way the events won't be time-multiplexed by the kernel and will be simultaneously active. iykyk. π
π PCP ENVIRONMENT π
environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. on each installation, the file /etc/pcp.conf contains the local values for these variables. and the $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). πΈ
π₯ SEE ALSO π₯
perfalloc(1), perfevent.conf(5), PCPIntro(1), pmcd(1), pmlogrewrite(1), PMAPI(3), pcp.conf(5), pcp.env(5) and sysctl(8).
and that's the whole page, bestie! π this one's brought to you by Performance Co-Pilot (PCP, the source, the moment, the icon) β go read the rest of her pages, she ate. mwah. πβ¨π¦
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- centos-stream 9: pcp-doc 6.3.7-14.el9 Β· GPL-2.0-or-later AND CC-BY-3.0
- debian trixie: pcp 6.3.8-1
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu questing: pcp 6.3.8-1
- ubuntu resolute: pcp 7.1.1-1
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (c) 2014-2015 Joseph White
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms