Tests: use configured processor count in snapshot tests
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 Tests: use configured processor count in snapshot tests
From: Jérémie Galarneau <[email protected]>
--- tests/regression/tools/snapshots/ust_test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/regression/tools/snapshots/ust_test +1 -1
@@ -182,7 +182,7 @@ function test_ust_local_snapshot () function test_ust_local_snapshot_max_size () { subbuf_size=8192 - num_cpus=`nproc` + num_cpus=$(conf_proc_count) # The minimum size limit is min(subbuf_size) * nb_streams max_size=$(($subbuf_size*$num_cpus))
Signature · 6 lines
2.7.0 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
PATCH 3/3 Tests: use configured processor count in tracefile count test
In reply to a message not in the archive--- tests/regression/tools/tracefile-limits/test_tracefile_count | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/regression/tools/tracefile-limits/test_tracefile_count +2 -2
@@ -27,10 +27,10 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" STATS_BIN="$TESTDIR/utils/babelstats.pl" NUM_TESTS=74 -NUM_CPUS=`nproc` - source $TESTDIR/utils/utils.sh +NUM_CPUS=$(conf_proc_count) + if [ ! -x "$TESTAPP_BIN" ]; then BAIL_OUT "No UST events binary detected." fi
Signature · 6 lines
2.7.0 _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Re: [PATCH lttng-tools stable-2.6 1/3] Tests: Introduce conf_proc_count()
In reply to a message not in the archiveAll three fixes have been merged to stable-2.6, thanks!
Quoted 47 lines · Michael Jeanson
From: Jérémie Galarneau <[email protected]>
Tests are using the nproc utility which return the number of _available_ CPUs. The distinction between online, available and configured CPUs is subtle, but important.
The number of "online" CPUs can change at runtime as CPUs are hot-plugged. This could happen during a test and result in unexpected results.
The number of "configured" CPUs includes any CPU which may be offline at the time.
The number of "available" CPUs, which is what is returned by the nproc utility, may differ from both "online" and "configured" counts. This is the case in containers which are assigned to a subset of configured CPUs.
Signed-off-by Jérémie Galarneau <[email protected]>--- tests/utils/utils.sh | 10 ++++++++++ 1 file changed, 10 insertions(+)tests/utils/utils.sh +10
-1@@ -92,6 +92,16 @@ function randstring() echo } +# Return the number of _configured_ CPUs. +function conf_proc_count() +{ + getconf _NPROCESSORS_CONF + if [ $? -ne 0 ]; then + diag "Failed to get the number of configured CPUs" + fi + echo +} + function lttng_enable_kernel_event { local sess_name=$1 --2.7.0
Signature · 7 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev