While mq_perf_tests runs with the default kselftest timeout limit, which
is 45 seconds, the test takes about 60 seconds to complete on i3.metal
AWS instances. Hence, the test always times out. Increase the timeout
to 180 seconds.
Fixes: 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second timeout per test")
Cc: <stable(a)vger.kernel.org> # 5.4.x
Signed-off-by: SeongJae Park <sj(a)kernel.org>
Reviewed-by: Kees Cook <keescook(a)chromium.org>
---
Changes from v2
(https://lore.kernel.org/r/20240220000243.162285-1-sj@kernel.org)
- Update commit message about the new timeout limit to 180 seconds
- Remove wrong Link: line
Changes from v1
(https://lore.kernel.org/r/20240208212925.68286-1-sj@kernel.org)
- Use 180 seconds timeout instead of 100 seconds
tools/testing/selftests/mqueue/setting | 1 +
1 file changed, 1 insertion(+)
create mode 100644 tools/testing/selftests/mqueue/setting
diff --git a/tools/testing/selftests/mqueue/setting b/tools/testing/selftests/mqueue/setting
new file mode 100644
index 000000000000..a953c96aa16e
--- /dev/null
+++ b/tools/testing/selftests/mqueue/setting
@@ -0,0 +1 @@
+timeout=180
--
2.39.2
Resolves a spelling error in the test log, preventing potential
confusion.
Signed-off-by: Vincenzo Mezzela <vincenzo.mezzela(a)gmail.com>
---
It is submitted as part of my application to the "Linux Kernel
Bug Fixing Spring Unpaid 2024" mentorship program of the Linux
Foundation.
.../testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
index 4562e13cb26b..717898894ef7 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
@@ -40,7 +40,7 @@ grep "id: \(unknown_\|sys_\)" events/raw_syscalls/sys_exit/hist > /dev/null || \
reset_trigger
-echo "Test histgram with log2 modifier"
+echo "Test histogram with log2 modifier"
echo 'hist:keys=bytes_req.log2' > events/kmem/kmalloc/trigger
for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
--
2.34.1
Add a test to exercize cpu hotplug with the function tracer active to
ensure that sensitive functions in idle path are excluded from being
traced. This helps catch issues such as the one fixed by commit
4b3338aaa74d ("powerpc/ftrace: Fix stack teardown in ftrace_no_trace").
Signed-off-by: Naveen N Rao <naveen(a)kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat(a)kernel.org>
---
.../ftrace/test.d/ftrace/func_hotplug.tc | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc
new file mode 100644
index 000000000000..ccfbfde3d942
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_hotplug.tc
@@ -0,0 +1,42 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# description: ftrace - function trace across cpu hotplug
+# requires: function:tracer
+
+if ! which nproc ; then
+ nproc() {
+ ls -d /sys/devices/system/cpu/cpu[0-9]* | wc -l
+ }
+fi
+
+NP=`nproc`
+
+if [ $NP -eq 1 ] ;then
+ echo "We cannot test cpu hotplug in UP environment"
+ exit_unresolved
+fi
+
+# Find online cpu
+for i in /sys/devices/system/cpu/cpu[1-9]*; do
+ if [ -f $i/online ] && [ "$(cat $i/online)" = "1" ]; then
+ cpu=$i
+ break
+ fi
+done
+
+if [ -z "$cpu" ]; then
+ echo "We cannot test cpu hotplug with a single cpu online"
+ exit_unresolved
+fi
+
+echo 0 > tracing_on
+echo > trace
+
+: "Set $(basename $cpu) offline/online with function tracer enabled"
+echo function > current_tracer
+echo 1 > tracing_on
+(echo 0 > $cpu/online)
+(echo "forked"; sleep 1)
+(echo 1 > $cpu/online)
+echo 0 > tracing_on
+echo nop > current_tracer
base-commit: 130a83879954a9fed35cf4474d223b4fcfd479fa
--
2.43.0
This series aims to keep the git status clean after building the
selftests by adding some missing .gitignore files and object inclusion
in existing .gitignore files. This is one of the requirements listed in
the selftests documentation for new tests, but it is not always followed
as desired.
After adding these .gitignore files and including the generated objects,
the working tree appears clean again.
To: Shuah Khan <shuah(a)kernel.org>
To: SeongJae Park <sj(a)kernel.org>
Cc: linux-kernel(a)vger.kernel.org
Cc: linux-kselftest(a)vger.kernel.org
Signed-off-by: Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
Changes in v4:
- damon: remove from the series to apply it in mm separately.
- Link to v3: https://lore.kernel.org/r/20240213-selftest_gitignore-v3-0-1f812368702b@gma…
Changes in v3:
- General: base on mm-unstable to avoid conflicts.
- damon: add missing Closes tag.
- Link to v2: https://lore.kernel.org/r/20240212-selftest_gitignore-v2-0-75f0de50a178@gma…
Changes in v2:
- Remove patch for netfilter (not relevant anymore).
- Add patch for damon (missing binary in .gitignore).
- Link to v1: https://lore.kernel.org/r/20240101-selftest_gitignore-v1-0-eb61b09adb05@gma…
---
Javier Carrasco (3):
selftests: uevent: add missing gitignore
selftests: thermal: intel: power_floor: add missing gitignore
selftests: thermal: intel: workload_hint: add missing gitignore
tools/testing/selftests/thermal/intel/power_floor/.gitignore | 1 +
tools/testing/selftests/thermal/intel/workload_hint/.gitignore | 1 +
tools/testing/selftests/uevent/.gitignore | 1 +
3 files changed, 3 insertions(+)
---
base-commit: 7e90b5c295ec1e47c8ad865429f046970c549a66
change-id: 20240101-selftest_gitignore-7da2c503766e
Best regards,
--
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
On Tue, 20 Feb 2024 at 11:57, Linus Torvalds
<torvalds(a)linux-foundation.org> wrote:
>
> It turns out that that commit is buggy for another reason, but it's
> hidden by the fact that apparently KUNIT_ASSERT_FALSE_MSG() doesn't
> check the format string.
The fix for that is this:
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -579,7 +579,7 @@ void __printf(2, 3) kunit_log_append(struct
string_stream *log, const char *fmt,
void __noreturn __kunit_abort(struct kunit *test);
-void __kunit_do_failed_assertion(struct kunit *test,
+void __printf(6,7) __kunit_do_failed_assertion(struct kunit *test,
const struct kunit_loc *loc,
enum kunit_assert_type type,
const struct kunit_assert *assert,
but that causes a *lot* of noise (not just in drm_buddy_test.c), so
I'm not going to apply that fix as-is. Clearly there's a lot of
incorrect format parameters that have never been checked.
Instead adding Shuah and the KUnit people to the participants, and
hoping that they will fix this up and we can get the format fixes for
KUnit in the 6.9 timeframe.
Side note: when I apply the above patch, the suggestions gcc spews out
look invalid. Gcc seems to suggest turning a a format string of '%d"
to "%ld" for a size_t variable. That's wrong. It should be "%zu".
A 'size_t' can in fact be 'unsigned int' on some platforms (not just
in theory), so %ld is really incorrect not just from a sign
perspective.
Anyway, I guess I will commit the immediate drm_buddy_test.c fix to
get rid of the build issue, but the KUnit message format string issue
will have to be a "let's get this fixed up _later_" issue.
Linus
This series adds a few missing functions to the shell KTAP helpers
script which are present in the C counterpart, kselftest.h.
This series depends on
"selftests: Move KTAP bash helpers to selftests common folder"
https://lore.kernel.org/all/20240102141528.169947-1-laura.nao@collabora.com/
Signed-off-by: Nícolas F. R. A. Prado <nfraprado(a)collabora.com>
---
Nícolas F. R. A. Prado (4):
selftests: ktap_helpers: Add helper to print diagnostic messages
selftests: ktap_helpers: Add helper to pass/fail test based on exit code
selftests: ktap_helpers: Add a helper to abort the test
selftests: ktap_helpers: Add a helper to finish the test
tools/testing/selftests/kselftest/ktap_helpers.sh | 39 +++++++++++++++++++++--
1 file changed, 37 insertions(+), 2 deletions(-)
---
base-commit: f1ca07220ad16a9efae7f68e4bade0db89b63a3c
change-id: 20240131-ktap-sh-helpers-extend-805b77ca773c
Best regards,
--
Nícolas F. R. A. Prado <nfraprado(a)collabora.com>
The typo in the description shows up in test logs and output.
This patch submission is part of my application to the Linux Foundation
mentorship program: Linux kernel Bug Fixing Spring Unpaid 2024.
Signed-off-by: Ali Zahraee <ahzahraee(a)gmail.com>
---
tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
index add7d5bf585d..c45094d1e1d2 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
@@ -1,6 +1,6 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
-# description: Test file and directory owership changes for eventfs
+# description: Test file and directory ownership changes for eventfs
original_group=`stat -c "%g" .`
original_owner=`stat -c "%u" .`
--
2.34.1