• Amber Lin's avatar
    drm/amdkfd: Add perf counters to topology · f4757347
    Amber Lin authored
    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: default avatarAmber Lin <Amber.Lin@amd.com>
    Signed-off-by: default avatarKent Russell <kent.russell@amd.com>
    Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
    Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
    Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
    f4757347
kfd_topology.h 5.59 KB