| Newsgroups |
gmane.comp.sysutils.pcp |
| Message-ID |
<[email protected]> |
[performancecopilot/pcp] Pull request opened by hkshaw1990 ( https://github.com/hkshaw1990 ) :
#277 perfevent_pmda: Add PMU events exported from kernel ( https://github.com/performancecopilot/pcp/pull/277 )
The perfevent pmda gets the event definitions from the libpfm library. So, to add a new platform counter, we need to add its definition to the libpfm library and use it here. This patch is the first step towards removing that dependency. It parses the kernel exported PMUs and their events from /sys/bus/event_source/devices, and calculates the config values for each of these events. However, we don't want to open all the events at once. Only the events which are mentioned in perfevent.conf under [dynamic] section will be opened. But, all the dynamic events will be listed with pminfo. For e.g. : $ pminfo [...] perfevent.hwcounters.software.context-switches.dutycycle perfevent.hwcounters.software.context-switches.value perfevent.hwcounters.software.page-faults.dutycycle perfevent.hwcounters.software.page-faults.value [...] perfevent.hwcounters.power.energy-cores.dutycycle perfevent.hwcounters.power.energy-cores.value perfevent.hwcounters.power.energy-ram.dutycycle perfevent.hwcounters.power.energy-ram.value [...] perfevent.hwcounters.msr.mperf.dutycycle perfevent.hwcounters.msr.mperf.value perfevent.hwcounters.msr.aperf.dutycycle perfevent.hwcounters.msr.aperf.value [...] perfevent.hwcounters.cpu.mem-stores.dutycycle perfevent.hwcounters.cpu.mem-stores.value perfevent.hwcounters.cpu.tx-capacity.dutycycle perfevent.hwcounters.cpu.tx-capacity.value perfevent.hwcounters.cpu.mem-loads.dutycycle perfevent.hwcounters.cpu.mem-loads.value perfevent.hwcounters.cpu.branch-misses.dutycycle perfevent.hwcounters.cpu.branch-misses.value [...] Now, say only the event cpu.branch-instructions is mentioned under [dynamic] section in the perfevent.conf file. In this case, we can only read the values for this event, all other dynamic events are disabled and will return invalid value. $ pmval perfevent.hwcounters.cpu.branch-misses.value metric: perfevent.hwcounters.cpu.branch-misses.value host: <> semantics: cumulative counter (converting to rate) units: count (converting to count / sec) samples: all cpu0 cpu1 cpu2 cpu3 3.028E+05 3.772E+05 3.757E+05 2.638E+05 4.382E+05 2.716E+05 2.888E+05 cpu.mem-loads is not added in the perfevent.conf file, so we won't be able to get any values out of it, even though, we can see it under pminfo. $ pmval perfevent.hwcounters.cpu.mem-loads.value metric: perfevent.hwcounters.cpu.mem-loads.value host: <> semantics: cumulative counter (converting to rate) units: count (converting to count / sec) samples: all No values available No values available This patch also adds software events whose configuration values are available under linux/perf_event.h : [...] perfevent.hwcounters.software.cpu-migrations.dutycycle perfevent.hwcounters.software.cpu-migrations.value perfevent.hwcounters.software.context-switches.dutycycle perfevent.hwcounters.software.context-switches.value perfevent.hwcounters.software.page-faults.dutycycle perfevent.hwcounters.software.page-faults.value [...]