linux_kselftest-next-6.16-rc1

-- Fixes
    - cpufreq test to not double suspend in rtcwake case.
    - compile error in pid_namespace test.
    - run_kselftest.sh to use readlink if realpath is not available.
    - cpufreq basic read and update testcases.
    - ftrace to add poll to a gen_file so test can find it at run-time.
    - spelling errors in perf_events test.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmgw1J8ACgkQCwJExA0N
 QxyHxg//Um5AMX2oPocPfKTctrvxgwdu9dsk1Cm1DfXwtaH6BZ2R34+fqlkNpBBO
 nRKhF17ArTslRNjTlnDZ/nh+7Pg7AU/ikyahT607div9DEQM4bXhuIBjd4KDKANK
 KlHrlbfP5TArGx81+OzuiRvLhVBO8JN5O5G9EtY1/NU5p6EhMYAt03n89/OQLe1T
 Lr3NIHsLOeQSk+jNW4mxAXRSJ0siQBrYls4SeeNKd+B/7gRHBVD7IrGXc6ruHMoB
 8DJDXgSjYrRXy3Do6jYhFvIGHap0pELYN3FpluEU5uW+K+CJuLWQWI1O6/pjIpc9
 Zk/S2JI8yg+6PMzLMvy1YtcUIM1oSV8wx9uWqR5thyFzJdeMcP5k+yXP6ErbHWTB
 ncSlqzEe88pI9ywxmiaqiK0Jf+IBArW1agcCDkORpJ2KCz5GeZU7wGPYH/Ohn8Y4
 7Ooqxb4jH5ZBofvSAM+mEjmPypS7VhQRa8pU0Ied+O79c+wyiK2su5u0pGpwZeW/
 4X2Q393OhT9g8aI2ZFsQYOYLTQuPnrbLQhyg7XqcmkZb5vAwVK8GNKaGNjb+qhz4
 sF1xA5ySRObj+5MHcR+JFtYKoPoyJVzkOblwvugLuAE8EGTlRIxXF5hJv/f/U/RD
 OE6u3dJX8O0Qa9ZJKX3b5Rt+qEG228/VxUQ3qILv5ikWnqkVL3w=
 =9kTs
 -----END PGP SIGNATURE-----

Merge tag 'linux_kselftest-next-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest updates from Shuah Khan:
 "Fixes:

   - cpufreq test to not double suspend in rtcwake case

   - compile error in pid_namespace test

   - run_kselftest.sh to use readlink if realpath is not available

   - cpufreq basic read and update testcases

   - ftrace to add poll to a gen_file so test can find it at run-time

   - spelling errors in perf_events test"

* tag 'linux_kselftest-next-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/run_kselftest.sh: Use readlink if realpath is not available
  selftests/timens: timerfd: Use correct clockid type in tclock_gettime()
  selftests/timens: Make run_tests() functions static
  selftests/timens: Print TAP headers
  selftests: pid_namespace: add missing sys/mount.h include in pid_max.c
  kselftest: cpufreq: Get rid of double suspend in rtcwake case
  selftests/cpufreq: Fix cpufreq basic read and update testcases
  selftests/ftrace: Convert poll to a gen_file
  selftests/perf_events: Fix spelling mistake "sycnhronize" -> "synchronize"
This commit is contained in:
Linus Torvalds 2025-05-26 14:25:23 -07:00
commit 2d2435e1c8
14 changed files with 46 additions and 12 deletions

@ -52,7 +52,14 @@ read_cpufreq_files_in_dir()
for file in $files; do
if [ -f $1/$file ]; then
printf "$file:"
cat $1/$file
#file is readable ?
local rfile=$(ls -l $1/$file | awk '$1 ~ /^.*r.*/ { print $NF; }')
if [ ! -z $rfile ]; then
cat $1/$file
else
printf "$file is not readable\n"
fi
else
printf "\n"
read_cpufreq_files_in_dir "$1/$file"
@ -83,10 +90,10 @@ update_cpufreq_files_in_dir()
for file in $files; do
if [ -f $1/$file ]; then
# file is writable ?
local wfile=$(ls -l $1/$file | awk '$1 ~ /^.*w.*/ { print $NF; }')
# file is readable and writable ?
local rwfile=$(ls -l $1/$file | awk '$1 ~ /^.*rw.*/ { print $NF; }')
if [ ! -z $wfile ]; then
if [ ! -z $rwfile ]; then
# scaling_setspeed is a special file and we
# should skip updating it
if [ $file != "scaling_setspeed" ]; then
@ -244,9 +251,10 @@ do_suspend()
printf "Failed to suspend using RTC wake alarm\n"
return 1
fi
else
echo $filename > $SYSFS/power/state
fi
echo $filename > $SYSFS/power/state
printf "Came out of $1\n"
printf "Do basic tests after finishing $1 to verify cpufreq state\n\n"

@ -6,6 +6,6 @@ TEST_PROGS := ftracetest-ktap
TEST_FILES := test.d settings
EXTRA_CLEAN := $(OUTPUT)/logs/*
TEST_GEN_PROGS = poll
TEST_GEN_FILES := poll
include ../lib.mk

@ -75,7 +75,7 @@ TEST(watermark_signal)
if (waitpid(child, &child_status, WSTOPPED) != child ||
!(WIFSTOPPED(child_status) && WSTOPSIG(child_status) == SIGSTOP)) {
fprintf(stderr,
"failed to sycnhronize with child errno=%d status=%x\n",
"failed to synchronize with child errno=%d status=%x\n",
errno,
child_status);
goto cleanup;

@ -10,6 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <syscall.h>
#include <sys/mount.h>
#include <sys/wait.h>
#include "../kselftest_harness.h"

@ -3,7 +3,14 @@
#
# Run installed kselftest tests.
#
BASE_DIR=$(realpath $(dirname $0))
# Fallback to readlink if realpath is not available
if which realpath > /dev/null; then
BASE_DIR=$(realpath $(dirname $0))
else
BASE_DIR=$(readlink -f $(dirname $0))
fi
cd $BASE_DIR
TESTS="$BASE_DIR"/kselftest-list.txt
if [ ! -r "$TESTS" ] ; then

@ -38,7 +38,7 @@ void *call_nanosleep(void *_args)
return NULL;
}
int run_test(int clockid, int abs)
static int run_test(int clockid, int abs)
{
struct timespec now = {}, rem;
struct thread_args args = { .now = &now, .rem = &rem, .clockid = clockid};
@ -115,6 +115,8 @@ int main(int argc, char *argv[])
{
int ret, nsfd;
ksft_print_header();
nscheck();
ksft_set_plan(4);

@ -36,6 +36,8 @@ int main(int argc, char *argv[])
return 0;
}
ksft_print_header();
nscheck();
ksft_set_plan(1);

@ -66,6 +66,8 @@ int main(int argc, char *argv[])
pid_t pid;
struct timespec mtime_now;
ksft_print_header();
nscheck();
ksft_set_plan(2);

@ -67,6 +67,8 @@ int main(int argc, char *argv[])
time_t offset = 10;
int nsfd;
ksft_print_header();
ksft_set_plan(8);
fill_function_pointers();

@ -180,6 +180,8 @@ int main(int argc, char *argv[])
{
int ret = 0;
ksft_print_header();
nscheck();
ksft_set_plan(2);

@ -151,6 +151,8 @@ int main(int argc, char *argv[])
time_t offset;
int ret = 0;
ksft_print_header();
nscheck();
check_supported_timers();

@ -15,7 +15,7 @@
#include "log.h"
#include "timens.h"
int run_test(int clockid, struct timespec now)
static int run_test(int clockid, struct timespec now)
{
struct itimerspec new_value;
long long elapsed;
@ -75,6 +75,8 @@ int main(int argc, char *argv[])
pid_t pid;
struct timespec btime_now, mtime_now;
ksft_print_header();
nscheck();
check_supported_timers();

@ -15,14 +15,14 @@
#include "log.h"
#include "timens.h"
static int tclock_gettime(clock_t clockid, struct timespec *now)
static int tclock_gettime(clockid_t clockid, struct timespec *now)
{
if (clockid == CLOCK_BOOTTIME_ALARM)
clockid = CLOCK_BOOTTIME;
return clock_gettime(clockid, now);
}
int run_test(int clockid, struct timespec now)
static int run_test(int clockid, struct timespec now)
{
struct itimerspec new_value;
long long elapsed;
@ -82,6 +82,8 @@ int main(int argc, char *argv[])
pid_t pid;
struct timespec btime_now, mtime_now;
ksft_print_header();
nscheck();
check_supported_timers();

@ -91,6 +91,8 @@ int main(int argc, char *argv[])
return check("child after exec", &now);
}
ksft_print_header();
nscheck();
ksft_set_plan(4);