Commit 7dc0e9c7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux_kselftest-next-6.7-rc1' of...

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

Pull kselftest updates from Shuah Khan:

 - kbuild kselftest-merge target fixes

 - fixes to several tests

 - resctrl test fixes and enhancements

 - ksft_perror() helper and reporting improvements

 - printf attribute to kselftest prints to improve reporting

 - documentation and clang build warning fixes

The bulk of the patches are for resctrl fixes and enhancements.

* tag 'linux_kselftest-next-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (51 commits)
  selftests/resctrl: Fix MBM test failure when MBA unavailable
  selftests/clone3: Report descriptive test names
  selftests:modify the incorrect print format
  selftests/efivarfs: create-read: fix a resource leak
  selftests/ftrace: Add riscv support for kprobe arg tests
  selftests/ftrace: add loongarch support for kprobe args char tests
  selftests/amd-pstate: Added option to provide perf binary path
  selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut
  selftests/resctrl: Move run_benchmark() to a more fitting file
  selftests/resctrl: Fix schemata write error check
  selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests
  selftests/resctrl: Fix feature checks
  selftests/resctrl: Refactor feature check to use resource and feature name
  selftests/resctrl: Move _GNU_SOURCE define into Makefile
  selftests/resctrl: Remove duplicate feature check from CMT test
  selftests/resctrl: Extend signal handler coverage to unmount on receiving signal
  selftests/resctrl: Fix uninitialized .sa_flags
  selftests/resctrl: Cleanup benchmark argument parsing
  selftests/resctrl: Remove ben_count variable
  selftests/resctrl: Make benchmark command const and build it with pointers
  ...
parents 5eda8f25 5247e6db
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ You can specify multiple tests to skip::
You can also specify a restricted list of tests to run together with a
dedicated skiplist::

  $  make TARGETS="bpf breakpoints size timers" SKIP_TARGETS=bpf kselftest
  $  make TARGETS="breakpoints size timers" SKIP_TARGETS=size kselftest

See the top-level tools/testing/selftests/Makefile for the list of all
possible targets.
@@ -165,7 +165,7 @@ To see the list of available tests, the `-l` option can be used::
The `-c` option can be used to run all the tests from a test collection, or
the `-t` option for specific single tests. Either can be used multiple times::

   $ ./run_kselftest.sh -c bpf -c seccomp -t timers:posix_timers -t timer:nanosleep
   $ ./run_kselftest.sh -c size -c seccomp -t timers:posix_timers -t timer:nanosleep

For other features see the script usage output, seen with the `-h` option.

@@ -210,7 +210,7 @@ option is supported, such as::
tests by using variables specified in `Running a subset of selftests`_
section::

    $ make -C tools/testing/selftests gen_tar TARGETS="bpf" FORMAT=.xz
    $ make -C tools/testing/selftests gen_tar TARGETS="size" FORMAT=.xz

.. _tar's auto-compress: https://www.gnu.org/software/tar/manual/html_node/gzip.html#auto_002dcompress

+2 −2
Original line number Diff line number Diff line
@@ -1367,8 +1367,8 @@ kselftest-%: headers FORCE
PHONY += kselftest-merge
kselftest-merge:
	$(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
	$(Q)find $(srctree)/tools/testing/selftests -name config | \
		xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
	$(Q)find $(srctree)/tools/testing/selftests -name config -o -name config.$(UTS_MACHINE) | \
		xargs $(srctree)/scripts/kconfig/merge_config.sh -y -m $(objtree)/.config
	$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig

# ---------------------------------------------------------------------------
+1 −2
Original line number Diff line number Diff line
@@ -30,8 +30,7 @@ import getopt
import Gnuplot
from numpy import *
from decimal import *
sys.path.append('../intel_pstate_tracer')
#import intel_pstate_tracer
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "intel_pstate_tracer"))
import intel_pstate_tracer as ipt

__license__ = "GPL version 2"
+11 −6
Original line number Diff line number Diff line
#!/bin/sh
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

# Testing and monitor the cpu desire performance, frequency, load,
@@ -66,12 +66,15 @@ post_clear_gitsource()

install_gitsource()
{
	if [ ! -d $git_name ]; then
	if [ ! -d $SCRIPTDIR/$git_name ]; then
		pushd $(pwd) > /dev/null 2>&1
		cd $SCRIPTDIR
		printf "Download gitsource, please wait a moment ...\n\n"
		wget -O $git_tar $gitsource_url > /dev/null 2>&1

		printf "Tar gitsource ...\n\n"
		tar -xzf $git_tar
		popd > /dev/null 2>&1
	fi
}

@@ -79,12 +82,14 @@ install_gitsource()
run_gitsource()
{
	echo "Launching amd pstate tracer for $1 #$2 tracer_interval: $TRACER_INTERVAL"
	./amd_pstate_trace.py -n tracer-gitsource-$1-$2 -i $TRACER_INTERVAL > /dev/null 2>&1 &
	$TRACER -n tracer-gitsource-$1-$2 -i $TRACER_INTERVAL > /dev/null 2>&1 &

	printf "Make and test gitsource for $1 #$2 make_cpus: $MAKE_CPUS\n"
	cd $git_name
	perf stat -a --per-socket -I 1000 -e power/energy-pkg/ /usr/bin/time -o ../$OUTFILE_GIT.time-gitsource-$1-$2.log make test -j$MAKE_CPUS > ../$OUTFILE_GIT-perf-$1-$2.log 2>&1
	cd ..
	BACKUP_DIR=$(pwd)
	pushd $BACKUP_DIR > /dev/null 2>&1
	cd $SCRIPTDIR/$git_name
	$PERF stat -a --per-socket -I 1000 -e power/energy-pkg/ /usr/bin/time -o $BACKUP_DIR/$OUTFILE_GIT.time-gitsource-$1-$2.log make test -j$MAKE_CPUS > $BACKUP_DIR/$OUTFILE_GIT-perf-$1-$2.log 2>&1
	popd > /dev/null 2>&1

	for job in `jobs -p`
	do
+15 −6
Original line number Diff line number Diff line
@@ -8,9 +8,12 @@ else
	FILE_MAIN=DONE
fi

source basic.sh
source tbench.sh
source gitsource.sh
SCRIPTDIR=`dirname "$0"`
TRACER=$SCRIPTDIR/../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py

source $SCRIPTDIR/basic.sh
source $SCRIPTDIR/tbench.sh
source $SCRIPTDIR/gitsource.sh

# amd-pstate-ut only run on x86/x86_64 AMD systems.
ARCH=$(uname -m 2>/dev/null | sed -e 's/i.86/x86/' -e 's/x86_64/x86/')
@@ -22,6 +25,7 @@ OUTFILE=selftest
OUTFILE_TBENCH="$OUTFILE.tbench"
OUTFILE_GIT="$OUTFILE.gitsource"

PERF=/usr/bin/perf
SYSFS=
CPUROOT=
CPUFREQROOT=
@@ -151,6 +155,7 @@ help()
	[-p <tbench process number>]
	[-l <loop times for tbench>]
	[-i <amd tracer interval>]
	[-b <perf binary>]
	[-m <comparative test: acpi-cpufreq>]
	\n"
	exit 2
@@ -158,7 +163,7 @@ help()

parse_arguments()
{
	while getopts ho:c:t:p:l:i:m: arg
	while getopts ho:c:t:p:l:i:b:m: arg
	do
		case $arg in
			h) # --help
@@ -189,6 +194,10 @@ parse_arguments()
				TRACER_INTERVAL=$OPTARG
				;;

			b) # --perf-binary
				PERF=`realpath $OPTARG`
				;;

			m) # --comparative-test
				COMPARATIVE_TEST=$OPTARG
				;;
@@ -202,8 +211,8 @@ parse_arguments()

command_perf()
{
	if ! command -v perf > /dev/null; then
		echo $msg please install perf. >&2
	if ! $PERF -v; then
		echo $msg please install perf or provide perf binary path as argument >&2
		exit $ksft_skip
	fi
}
Loading