History log of /linux-master/tools/testing/selftests/vDSO/vdso_test_abi.c
Revision Date Author Comments
# 25cfe960 23-Nov-2023 Mark Brown <broonie@kernel.org>

kselftest/vDSO: Use ksft_print_msg() rather than printf in vdso_test_abi

There are a couple of raw printf() calls in vdso_test_abi which result in
non KTAP conforment output such as

[vDSO kselftest] VDSO_VERSION: LINUX_2.6

Convert them to use ksft_print_msg() so that they don't cause confusion for
parsers.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>


# e63e1354 23-Nov-2023 Mark Brown <broonie@kernel.org>

kselftest/vDSO: Fix message formatting for clock_id logging

When logging the ID of the currently tested clock vdso_test_clock() puts a
spurious newline at the start of the format string resulting in output
such as

#
clock_id: CLOCK_BOOTTIME

which is a valid but empty KTAP informational message followed by a non
conferment output line. Remove the initial newline to create a more KTAP
friendly

# clock_id: CLOCK_BOOTTIME

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>


# 60e76e7a 23-Nov-2023 Mark Brown <broonie@kernel.org>

kselftest/vDSO: Make test name reporting for vdso_abi_test tooling friendly

The test results from vdso_abi_test are all formatted using a series of
macros:

#define VDSO_TEST_PASS_MSG() "\n%s(): PASS\n", __func__
#define VDSO_TEST_FAIL_MSG(x) "\n%s(): %s FAIL\n", __func__, x
#define VDSO_TEST_SKIP_MSG(x) "\n%s(): SKIP: Could not find %s\n", __func__, x

which don't play nicely with automated KTAP parsers since the actual KTAP
lines are in the form

ok 1

with no test name and we get an additional log line such as

vdso_test_gettimeofday(): PASS

with no preceeding # as KTAP requires. The lack of a test name means that
many automation systems will have a hard time distinguishing between the
different tests or correlating results between runs, the lack of # is less
severe but could potentially cause confusion.

Fix these issues by rewriting all the result reporting to include both the
vDSO function name being tested and (where there is one) the name of the
clock being tested in the main KTAP line. Since we have tests both with and
without a specific clock we abandon the helper macros and just put the
format strings used directly in the ksft_ API calls. When we fail to look
up the relevant vDSO symbol we add a separate print statement explaining
why the skip is being done. This gives output such as:

ok 1 __vdso_gettimeofday
# clock_id: CLOCK_REALTIME
# The time is 1700673118.58091596
ok 2 __vdso_clock_gettime CLOCK_REALTIME

which is much easier for test automation to work with.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>


# ec049891 31-Jan-2022 Vincenzo Frascino <vincenzo.frascino@arm.com>

kselftest: Fix vdso_test_abi return status

vdso_test_abi contains a batch of tests that verify the validity of the
vDSO ABI.

When a vDSO symbol is not found the relevant test is skipped reporting
KSFT_SKIP. All the tests return values are then added in a single
variable which is checked to verify failures. This approach can have
side effects which result in reporting the wrong kselftest exit status.

Fix vdso_test_abi verifying the return code of each test separately.

Cc: Shuah Khan <shuah@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>


# 693f5ca0 26-Oct-2020 Vincenzo Frascino <vincenzo.frascino@arm.com>

kselftest: Extend vDSO selftest

The current version of the multiarch vDSO selftest verifies only
gettimeofday.

Extend the vDSO selftest to the other library functions:
- time
- clock_getres
- clock_gettime

The extension has been used to verify the unified vdso library on the
supported architectures.

Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>