* [PATCH net-next v1 1/3] selftests: rds: Fix stale log clean up
2026-05-07 23:32 [PATCH net-next v1 0/3] Log clean up and TAP follow ups Allison Henderson
@ 2026-05-07 23:32 ` Allison Henderson
2026-05-07 23:32 ` [PATCH net-next v1 2/3] selftests: rds: Fix TAP-prefixed prints in check_gcov* Allison Henderson
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-05-07 23:32 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
Since rds self tests no longer has a default folder, users must
specify a log collection folder if they want to collect logs.
Currently the log folder is deleted and recreated, but this can
be dangerous if the user exports RDS_LOG_DIR=/tmp or /var/log.
This patch corrects the clean up to delete only rds log artifacts
from the log folder, and further prefixes rds specific logs as rds*
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/run.sh | 10 +++++++---
tools/testing/selftests/net/rds/test.py | 2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/net/rds/run.sh b/tools/testing/selftests/net/rds/run.sh
index 2404a889767a..4930aed8846b 100755
--- a/tools/testing/selftests/net/rds/run.sh
+++ b/tools/testing/selftests/net/rds/run.sh
@@ -189,17 +189,21 @@ check_gcov_conf
TRACE_CMD=()
if [[ -n "$LOG_DIR" ]]; then
- rm -fr "$LOG_DIR"
FLAGS+=("-d" "$LOG_DIR")
TRACE_FILE="${LOG_DIR}/rds-strace.txt"
COVR_DIR="${LOG_DIR}/coverage/"
+ DMESG_FILE="${LOG_DIR}/rds-dmesg.out"
+
mkdir -p "$LOG_DIR"
mkdir -p "$COVR_DIR"
- echo "#Traces will be logged to ${TRACE_FILE}"
rm -f "$TRACE_FILE"
+ rm -f "$DMESG_FILE"
+ rm -f "$LOG_DIR"/rds-*.pcap
+ rm -f "$COVR_DIR"/gcovr*
+ echo "# Traces will be logged to ${TRACE_FILE}"
TRACE_CMD=(strace -T -tt -o "${TRACE_FILE}")
fi
@@ -210,7 +214,7 @@ echo "#running RDS tests..."
test_rc=$?
if [[ -n "$LOG_DIR" ]]; then
- dmesg > "${LOG_DIR}/dmesg.out"
+ dmesg > "${DMESG_FILE}"
fi
if [[ -n "$LOG_DIR" ]] && [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
diff --git a/tools/testing/selftests/net/rds/test.py b/tools/testing/selftests/net/rds/test.py
index d19d30e5ec6f..e1813e43fb4e 100755
--- a/tools/testing/selftests/net/rds/test.py
+++ b/tools/testing/selftests/net/rds/test.py
@@ -151,7 +151,7 @@ tcpdump_procs = []
# Start a packet capture on each network
if logdir is not None:
for net in [NET0, NET1]:
- pcap = logdir+'/'+net+'.pcap'
+ pcap = logdir+'/rds-'+net+'.pcap'
tcpdump_cmd = ['ip', 'netns', 'exec', net, '/usr/sbin/tcpdump']
sudo_user = os.environ.get('SUDO_USER')
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next v1 2/3] selftests: rds: Fix TAP-prefixed prints in check_gcov*
2026-05-07 23:32 [PATCH net-next v1 0/3] Log clean up and TAP follow ups Allison Henderson
2026-05-07 23:32 ` [PATCH net-next v1 1/3] selftests: rds: Fix stale log clean up Allison Henderson
@ 2026-05-07 23:32 ` Allison Henderson
2026-05-07 23:32 ` [PATCH net-next v1 3/3] selftests: rds: Disarm signal alarm on test completion Allison Henderson
2026-05-10 17:30 ` [PATCH net-next v1 0/3] Log clean up and TAP follow ups patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-05-07 23:32 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
This patch adds the # prefix to info and warning prints in
the check_gcov* routines. Since these routines do not exit,
as the other check_* routines do, the output here should be
kept TAP compliant.
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/run.sh | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/net/rds/run.sh b/tools/testing/selftests/net/rds/run.sh
index 4930aed8846b..424fd57401d8 100755
--- a/tools/testing/selftests/net/rds/run.sh
+++ b/tools/testing/selftests/net/rds/run.sh
@@ -35,7 +35,7 @@ GCOV_CMD=gcov
check_gcov_env()
{
if ! which "$GCOV_CMD" > /dev/null 2>&1; then
- echo "Warning: Could not find gcov. "
+ echo "# Warning: Could not find gcov. "
GENERATE_GCOV_REPORT=0
return
fi
@@ -48,7 +48,7 @@ check_gcov_env()
GCOV_CMD=gcov-$(gcc -dumpversion)
if ! which "$GCOV_CMD" > /dev/null 2>&1; then
- echo "Warning: Could not find an appropriate gcov installation. \
+ echo "# Warning: Could not find an appropriate gcov installation. \
gcov version must match gcc version"
GENERATE_GCOV_REPORT=0
return
@@ -58,11 +58,11 @@ check_gcov_env()
GCOV_VER=$($GCOV_CMD -v | grep gcov | awk '{print $3}'| \
awk 'BEGIN {FS="-"}{print $1}')
if [ "$GCOV_VER" != "$GCC_VER" ]; then
- echo "Warning: Could not find an appropriate gcov installation. \
+ echo "# Warning: Could not find an appropriate gcov installation. \
gcov version must match gcc version"
GENERATE_GCOV_REPORT=0
else
- echo "Warning: Mismatched gcc and gcov detected. Using $GCOV_CMD"
+ echo "# Warning: Mismatched gcc and gcov detected. Using $GCOV_CMD"
fi
fi
}
@@ -71,20 +71,20 @@ check_gcov_env()
check_gcov_conf()
{
if ! grep -x "CONFIG_GCOV_PROFILE_RDS=y" "$kconfig" > /dev/null 2>&1; then
- echo "INFO: CONFIG_GCOV_PROFILE_RDS should be enabled for coverage reports"
+ echo "# INFO: CONFIG_GCOV_PROFILE_RDS should be enabled for coverage reports"
GENERATE_GCOV_REPORT=0
fi
if ! grep -x "CONFIG_GCOV_KERNEL=y" "$kconfig" > /dev/null 2>&1; then
- echo "INFO: CONFIG_GCOV_KERNEL should be enabled for coverage reports"
+ echo "# INFO: CONFIG_GCOV_KERNEL should be enabled for coverage reports"
GENERATE_GCOV_REPORT=0
fi
if grep -x "CONFIG_GCOV_PROFILE_ALL=y" "$kconfig" > /dev/null 2>&1; then
- echo "INFO: CONFIG_GCOV_PROFILE_ALL should be disabled for coverage reports"
+ echo "# INFO: CONFIG_GCOV_PROFILE_ALL should be disabled for coverage reports"
GENERATE_GCOV_REPORT=0
fi
if [ "$GENERATE_GCOV_REPORT" -eq 0 ]; then
- echo "To enable gcov reports, please run "\
+ echo "# To enable gcov reports, please run "\
"\"tools/testing/selftests/net/rds/config.sh -g\" and rebuild the kernel"
else
# if we have the required kernel configs, proceed to check the environment to
@@ -208,7 +208,7 @@ if [[ -n "$LOG_DIR" ]]; then
fi
set +e
-echo "#running RDS tests..."
+echo "# running RDS tests..."
"${TRACE_CMD[@]}" python3 "$(dirname "$0")/test.py" "${FLAGS[@]}" -t "$TIMEOUT"
test_rc=$?
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next v1 3/3] selftests: rds: Disarm signal alarm on test completion
2026-05-07 23:32 [PATCH net-next v1 0/3] Log clean up and TAP follow ups Allison Henderson
2026-05-07 23:32 ` [PATCH net-next v1 1/3] selftests: rds: Fix stale log clean up Allison Henderson
2026-05-07 23:32 ` [PATCH net-next v1 2/3] selftests: rds: Fix TAP-prefixed prints in check_gcov* Allison Henderson
@ 2026-05-07 23:32 ` Allison Henderson
2026-05-10 17:30 ` [PATCH net-next v1 0/3] Log clean up and TAP follow ups patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Allison Henderson @ 2026-05-07 23:32 UTC (permalink / raw)
To: netdev, pabeni, edumazet, kuba, horms, linux-rdma, achender,
linux-kselftest, shuah
A race in stop_pcaps is possible if the test completes and then
times out while waiting for the tcpdump process to exit. The
signal handler may fire again and needlessly call stop_pcap a
second time. Fix this by disabling the alarm after normal
test completion.
Also if there are no tcpdump processes to wait on, stop_pcaps can
just exit. This avoids misleading prints when there are no procs
to collect dumps from.
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/test.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/net/rds/test.py b/tools/testing/selftests/net/rds/test.py
index e1813e43fb4e..6db606779231 100755
--- a/tools/testing/selftests/net/rds/test.py
+++ b/tools/testing/selftests/net/rds/test.py
@@ -77,6 +77,10 @@ def stop_pcaps():
completes after the signal handler is fired. List will be empty
if logdir is not set
"""
+
+ if not tcpdump_procs:
+ return
+
ksft_pr("Stopping network packet captures")
while tcpdump_procs:
proc = tcpdump_procs.pop()
@@ -279,6 +283,10 @@ for s in sockets:
pass
ksft_pr(f"getsockopt(): {nr_success}/{nr_error}")
+
+# cancel timeout
+signal.alarm(0)
+
stop_pcaps()
# We're done sending and receiving stuff, now let's check if what
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net-next v1 0/3] Log clean up and TAP follow ups
2026-05-07 23:32 [PATCH net-next v1 0/3] Log clean up and TAP follow ups Allison Henderson
` (2 preceding siblings ...)
2026-05-07 23:32 ` [PATCH net-next v1 3/3] selftests: rds: Disarm signal alarm on test completion Allison Henderson
@ 2026-05-10 17:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-10 17:30 UTC (permalink / raw)
To: Allison Henderson
Cc: netdev, pabeni, edumazet, kuba, horms, linux-rdma,
linux-kselftest, shuah
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 7 May 2026 16:32:10 -0700 you wrote:
> Hi all,
>
> This is a follow up series to the "Log collection, TAP compliance and
> cleanups" set. The sashiko report had made some points that I thought
> was worth addressing. This patch set fixes a few more TAP compliance
> prints in the check_gcov* routines. Also since the user must now pass
> in the log folder to collect logs, log clean up is tightened to only
> remove rds* prefixed artifacts instead of the entire folder. Lastly a
> the signal handler alarm should be disarmed after the completes to
> avoid multiple calls to the stop_pcaps routine.
>
> [...]
Here is the summary with links:
- [net-next,v1,1/3] selftests: rds: Fix stale log clean up
https://git.kernel.org/netdev/net-next/c/4840467c84de
- [net-next,v1,2/3] selftests: rds: Fix TAP-prefixed prints in check_gcov*
https://git.kernel.org/netdev/net-next/c/490778834a42
- [net-next,v1,3/3] selftests: rds: Disarm signal alarm on test completion
https://git.kernel.org/netdev/net-next/c/08724ab1dc17
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread