OSDN Git Service

drm/amdkfd: Add perf counters to topology
authorAmber Lin <Amber.Lin@amd.com>
Sat, 9 Dec 2017 04:09:00 +0000 (23:09 -0500)
committerOded Gabbay <oded.gabbay@gmail.com>
Sat, 9 Dec 2017 04:09:00 +0000 (23:09 -0500)
commitf475734729843d0d7b1cd70b9357285d05ca65e3
tree146cee1716dbfbc072271c3fe0dc916602d9bdd8
parent3a87177eb14113bbe8cd95a276af2c412eced6ac
drm/amdkfd: Add perf counters to topology

For hardware blocks whose performance counters are accessed via MMIO
registers, KFD provides the support for those privileged blocks.

IOMMU is one of those privileged blocks. Most performance counter properties
required by Thunk are available at /sys/bus/event_source/devices/amd_iommu.

This patch adds properties to topology in KFD sysfs for information not
available in /sys/bus/event_source/devices/amd_iommu. They are shown at
/sys/devices/virtual/kfd/kfd/topology/nodes/0/perf/iommu/ formatted as
/sys/devices/virtual/kfd/kfd/topology/nodes/0/perf/<block>/<property>, i.e.
/sys/devices/virtual/kfd/kfd/topology/nodes/0/perf/iommu/max_concurrent.

For dGPUs, who don't have IOMMU, nothing appears under
/sys/devices/virtual/kfd/kfd/topology/nodes/0/perf.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Signed-off-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c
drivers/gpu/drm/amd/amdkfd/kfd_topology.h