Skip to content

Commit

Permalink
powerpc/vpa_pmu: Add interface to expose vpa counters via perf
Browse files Browse the repository at this point in the history
The pseries SPLPAR machines can retrieve a log of dispatch and preempt
events from the hypervisor using data from Disptach Trace Log(DTL) buffer.
With this information, user can retrieve when and why each dispatch & preempt
has occured. Add an interface to expose the Virtual Processor Area(VPA)
dtl counters via perf.

The following events are available and exposed in sysfs:

  vpa_dtl/dtl_cede/ - Trace voluntary (OS initiated) virtual processor waits
  vpa_dtl/dtl_preempt/ - Trace time slice preempts
  vpa_dtl/dtl_fault/ - Trace virtual partition memory page faults.
  vpa_dtl/dtl_all/ - Trace all (dtl_cede/dtl_preempt/dtl_fault)

Added interface defines supported event list, config fields for the
event attributes and their corresponding bit values which are exported
via sysfs. User could use the standard perf tool to access
perf events exposed via vpa-pmu.

The VPA DTL PMU counters do not interrupt on overflow. Therefore, the kernel
needs to poll the counters to avoid missing an overflow. Added hrtimer
code to do this. The timer interval can be provided by user via
sample_period field. There is one hrtimer per-cpu.

Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
  • Loading branch information
kjain101 authored and root committed Jul 24, 2024
1 parent 14ce5a6 commit d5160d2
Show file tree
Hide file tree
Showing 3 changed files with 420 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ obj-$(CONFIG_PPC_POWERNV) += imc-pmu.o
obj-$(CONFIG_FSL_EMB_PERF_EVENT) += core-fsl-emb.o
obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o e6500-pmu.o

obj-$(CONFIG_HV_PERF_CTRS) += hv-24x7.o hv-gpci.o hv-common.o
obj-$(CONFIG_HV_PERF_CTRS) += hv-24x7.o hv-gpci.o hv-common.o vpa-pmu.o

obj-$(CONFIG_PPC_8xx) += 8xx-pmu.o

Expand Down
Loading

0 comments on commit d5160d2

Please sign in to comment.