Tests: use CPU ids from online ranges
authorKienan Stewart <kstewart@efficios.com>
Tue, 15 Aug 2023 15:50:16 +0000 (11:50 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 21 Aug 2023 18:16:47 +0000 (14:16 -0400)
commite03bdee2bbcb11d3b5c43578b90cdc1d15f8262b
tree0a5e7dc30609d6bd8eb61e58bb93f8778803521e
parente0571aa7d88c6607e769e8f723fd5d9e63323b0e
Tests: use CPU ids from online ranges

test_tracefile_count could fail randomly on systems where there are CPUs
present but not online. For example:

  $ cat /sys/devices/system/cpu/online
  0-7
  $ cat /sys/devices/system/cpu/present
  0-39

When a CPU is present, it will have an entry in
/sys/devices/system/cpu/cpuX for it's ID, and thus the test may pick
that CPU's ID. However, a present CPU which is not online is not a valid
target for taskset.

In cases where `get_any_available_cpu` is used with task set, the tests
could fail for a similar reason. This case can be somewhat less common,
because it would return the numerically lowest CPU first; however, with
online as follows cpu 0 isn't available and taskset fails.

  $ cat /sys/devices/system/cpu/online
  18-19,135,142
  $ cat /sys/devices/system/cpu/present
  0-167

Change-Id: I06ac2e67495552f54765794b154acc9e8e9990ec
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/snapshots/ust_test
tests/regression/tools/tracefile-limits/test_tracefile_count
tests/utils/utils.sh
This page took 0.024846 seconds and 4 git commands to generate.