Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

84 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Test script for loading and verifying the PMU stub module
set -e
echo "=== PMU Stub Module Test ==="
echo
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "This script must be run with sudo"
echo "Usage: sudo ./test_module.sh"
exit 1
fi
# Module path
MODULE_PATH="build/src/amdgpu_pmu.ko"
# Check if module exists
if [ ! -f "$MODULE_PATH" ]; then
echo "Error: Module not found at $MODULE_PATH"
echo "Please build the module first with: cmake -B build && cmake --build build"
exit 1
fi
echo "1. Loading module with debug enabled..."
insmod $MODULE_PATH debug_enable=1 timer_period_ms=100
echo " ✓ Module loaded successfully"
echo
echo "2. Verifying module is loaded..."
if lsmod | grep -q amdgpu_pmu; then
echo " ✓ Module found in lsmod:"
lsmod | grep amdgpu_pmu
else
echo " ✗ Module not found in lsmod"
exit 1
fi
echo
echo "3. Checking kernel logs..."
dmesg | tail -20 | grep -i amdgpu_pmu || true
echo
echo "4. Checking sysfs interface..."
if [ -d "/sys/bus/event_source/devices/pmu_stub" ]; then
echo " ✓ Sysfs interface created at /sys/bus/event_source/devices/pmu_stub"
echo " Contents:"
ls -la /sys/bus/event_source/devices/amdgpu_pmu/
else
echo " ✗ Sysfs interface not found"
fi
echo
echo "5. Checking perf integration..."
echo " Perf PMU list (filtered for pmu_stub):"
perf list | grep -i amdgpu_pmu || echo " Note: pmu_stub events not visible in perf list"
echo
echo "6. Testing perf stat with module..."
echo " Running: perf stat -e amdgpu_pmu/cycles/ sleep 0.1"
perf stat -e amdgpu_pmu/cycles/ sleep 0.1 2>&1 || echo " Note: Direct perf usage may require additional setup"
echo
echo "7. Module information:"
modinfo $MODULE_PATH
echo
echo "8. Unloading module..."
rmmod amdgpu_pmu
echo " ✓ Module unloaded successfully"
echo
echo "9. Verifying module is unloaded..."
if ! lsmod | grep -q amdgpu_pmu; then
echo " ✓ Module successfully removed from kernel"
else
echo " ✗ Module still loaded"
exit 1
fi
echo
echo "=== Test Complete ==="
echo "All basic module operations completed successfully!"