Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf cs-etm: Test sparse CPU maps

We only currently test with default (all CPUs) or --per-thread mode.

Different permutations of the "-C" option can affect decoding so add
tests for some of them.

Signed-off-by: James Clark <james.clark@linaro.org>
Tested-by: Leo Yan <leo.yan@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

James Clark and committed by
Arnaldo Carvalho de Melo
3d020f2e a70493e2

+54
+54
tools/perf/tests/shell/test_arm_coresight.sh
··· 198 198 arm_cs_report "CoreSight basic testing with '$*'" $err 199 199 } 200 200 201 + arm_cs_etm_test_cpu_list() { 202 + echo "Testing sparse CPU list: $1" 203 + perf record -o ${perfdata} -e cs_etm//u -C $1 \ 204 + -- taskset --cpu-list $1 true > /dev/null 2>&1 205 + perf_script_branch_samples true 206 + err=$? 207 + arm_cs_report "CoreSight sparse CPUs with '$*'" $err 208 + } 209 + 210 + arm_cs_etm_sparse_cpus_test() { 211 + # Iterate for every ETM device 212 + cpus=() 213 + for dev in /sys/bus/event_source/devices/cs_etm/cpu*; do 214 + # Canonicalize the path 215 + dev=`readlink -f $dev` 216 + 217 + # Find the ETM device belonging to which CPU 218 + cpus+=("$(cat $dev/cpu)") 219 + done 220 + 221 + mapfile -t cpus < <(printf '%s\n' "${cpus[@]}" | sort -n) 222 + total=${#cpus[@]} 223 + 224 + # Need more than 1 to test 225 + if [ $total -le 1 ]; then 226 + return 0 227 + fi 228 + 229 + half=$((total / 2)) 230 + 231 + # First half 232 + first_half=$(IFS=,; echo "${cpus[*]:0:$half}") 233 + arm_cs_etm_test_cpu_list $first_half 234 + 235 + # Second half 236 + second_half=$(IFS=,; echo "${cpus[*]:$half}") 237 + arm_cs_etm_test_cpu_list $second_half 238 + 239 + # Odd list is the same as halves unless >= 4 CPUs 240 + if [ $total -lt 4 ]; then 241 + return 0 242 + fi 243 + 244 + # Odd indices 245 + odd_cpus=() 246 + for ((i=1; i<total; i+=2)); do 247 + odd_cpus+=("${cpus[$i]}") 248 + done 249 + odd_list=$(IFS=,; echo "${odd_cpus[*]}") 250 + arm_cs_etm_test_cpu_list $odd_list 251 + } 252 + 201 253 arm_cs_etm_traverse_path_test 202 254 arm_cs_etm_system_wide_test 203 255 arm_cs_etm_snapshot_test ··· 262 210 arm_cs_etm_basic_test -e cs_etm/timestamp=1/ -a 263 211 arm_cs_etm_basic_test -e cs_etm/timestamp=0/ 264 212 arm_cs_etm_basic_test -e cs_etm/timestamp=1/ 213 + 214 + arm_cs_etm_sparse_cpus_test 265 215 266 216 exit $glb_err