Repository navigation
Conversation
| else | ||
| test_result_record FAIL "Online CPUs without a PMU instance:$missing" | ||
| fi | ||
| elif [ "$device_count" -eq 1 ]; then |
There was a problem hiding this comment.
When multiple PMU instances are present and any instance lacks cpus or cpumask, this path only logs a warning and records no result for the promised CPU coverage check. The suite can still finish PASS even though it did not prove every online CPU is served, record a FAIL or explicit SKIP for that multi-PMU unknown state instead of falling through.
| OUT_DIR=$(test_create_run_directory "$PWD/results/$TESTNAME") || test_result_finish FAIL "Cannot create evidence directory" | ||
| COUNTS="$OUT_DIR/counts.txt" | ||
| : >"$COUNTS" | ||
| FIRST_CPU="$(get_online_cpus | awk 'NR==1')" |
There was a problem hiding this comment.
This selects only the first online CPU and all required event and group measurements run there. On heterogeneous systems, a PMU serving another CPU mask can fail cycles, instructions or grouping while this suite still passes, iterate the discovered PMUs with pmu_first_cpu_of_device or narrow the suite to single-CPU smoke coverage.
There was a problem hiding this comment.
Fixed in dbfec2c. The checks now run per PMU instance, on the first online CPU served by each instance.
| fi | ||
| ;; | ||
| *) | ||
| test_result_record FAIL "$event perf stat failed, see $out" |
There was a problem hiding this comment.
Perf failure details are kept only in files under results/, while the YAML publishes only the .res file after the runner. Replay a bounded excerpt with the existing log_file_with_label helper before recording the FAIL or missing-event result so direct runs and LAVA show the actual perf error.
There was a problem hiding this comment.
Fixed in dbfec2c. Failed, unsupported-required and zero-count paths now replay the perf output with pmu_replay_output.
Add Runner/utils/lib_pmu.sh with helpers to discover armv8_pmuv3 PMU instances from sysfs and to run bounded, optionally CPU-pinned perf stat measurements. Add the PMU_Discovery suite that validates the perf type id, event format, named and architected events, CPU coverage and perf hardware event listing. Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
19dcd88 to
d1a9aa6
Compare
| # PMU instance, so heterogeneous systems are covered per PMU. | ||
| validate_pmu() { | ||
| PMU_DEV="$1" | ||
| FIRST_CPU="$(pmu_first_cpu_of_device "$PMU_DEV")" |
There was a problem hiding this comment.
This records per-PMU measurements using FIRST_CPU, but pmu_measure only applies taskset -c when taskset exists and otherwise runs the workload unpinned. On images without taskset, the suite can report a later PMU instance passed even though no workload was forced onto one of its CPUs, require taskset or cpu_is_schedulable "$FIRST_CPU" before per-PMU measurement and SKIP when it is unavailable.
There was a problem hiding this comment.
Fixed in dbfec2c. With more than one PMU instance a missing taskset, or a CPU that fails cpu_is_schedulable, now records SKIP for that PMU instead of running unpinned. A single PMU may still run unpinned. README updated.
There was a problem hiding this comment.
Fixed in the current head. Multi-PMU runs now SKIP before measurement when taskset is missing, and they call cpu_is_schedulable "$FIRST_CPU" before pinned per-PMU measurements.
Validate generic PMU hardware events with perf stat (cycles, instructions, branches, branch-misses, bus-cycles, stalls) and their cross-event consistency and grouping. Signed-off-by: Vamsee Narapareddi <vnarapar@qti.qualcomm.com>
d1a9aa6 to
dbfec2c
Compare
Summary
Adds the
PMU_Hardware_Eventssuite (PR 3 of 5 PMU validation PRs):run.sh, LAVA YAML and README underRunner/suites/Kernel/Baseport/PMU_Hardware_Events.cyclesandinstructionsare required;branches,branch-misses,bus-cyclesand stall events are optional (SKIP when unsupported). Also checks IPC upper bound, branch-misses <= branches, stalls <= cycles, and{cycles,instructions}grouping.Merge order
Depends on #727 - merge #727 first. This suite uses
Runner/utils/lib_pmu.shintroduced there. This branch is based on #727, so until it merges the diff also shows its commit. Once #727 is merged, only this suite's commit remains. PRs 2-5 are independent of each other and can merge in any order after #727.Validation
-s sh -e SC1091,SC2230,SC3043): clean.sh -nsyntax check: clean. Git modes:run.sh100755, YAML and README 100644.