From: Allison Henderson <achender@kernel.org>
To: netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com,
kuba@kernel.org, horms@kernel.org, linux-rdma@vger.kernel.org,
achender@kernel.org
Subject: [PATCH net-next v1 4/6] selftests: rds: Fix gcov and pcap collection
Date: Mon, 27 Apr 2026 16:29:25 -0700 [thread overview]
Message-ID: <20260427232927.2712755-5-achender@kernel.org> (raw)
In-Reply-To: <20260427232927.2712755-1-achender@kernel.org>
The vng guest shares the host filesystem via 9p and runs a minimal
systemd inherited from the host's /lib/systemd/system/. As a result,
which filesystems get auto-mounted in the guest depends on the host OS
and its systemd version.
The tcpdump pcaps are initially saved to /tmp because 9p does not support
chown which tcpdump requires. But whether /tmp is already a tmpfs depends
on the host's systemd configuration and may still sometimes fail if /tmp
is not mounted by default. Fix this by mounting tmpfs on /tmp in run.sh
when it is not already a separately mounted filesystem.
A similar dependency exists for gcov. debugfs is not mounted automatically
in vng guest, so the gcov data copy from /sys/kernel/debug/gcov/
silently finds nothing depending on whether debugfs is mounted by default
on the host OS. Fix this by mounting debugfs in run.sh before copying the
gcda files.
Finally, when invoked through the kselftest runner, the working directory
is the test directory rather than the kernel source root. gcovr defaults
--root to the current working directory, causing it to filter out all
coverage data for files under net/rds/ since they are not under the test
directory. Fix this by passing --root to gcovr explicitly.
Signed-off-by: Allison Henderson <achender@kernel.org>
---
tools/testing/selftests/net/rds/run.sh | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/rds/run.sh b/tools/testing/selftests/net/rds/run.sh
index bc2e53126aab..3fc116d23410 100755
--- a/tools/testing/selftests/net/rds/run.sh
+++ b/tools/testing/selftests/net/rds/run.sh
@@ -197,6 +197,13 @@ COVR_DIR="${LOG_DIR}/coverage/"
mkdir -p "$LOG_DIR"
mkdir -p "$COVR_DIR"
+# tcpdump saves pcaps to /tmp because it requires chown to save the
+# pcap but chown is not supported by 9p. Mount tmpfs on /tmp if it is
+# not already a separate filesystem
+if ! mountpoint -q /tmp 2>/dev/null; then
+ mount -t tmpfs tmpfs /tmp
+fi
+
set +e
echo running RDS tests...
echo Traces will be logged to "$TRACE_FILE"
@@ -210,6 +217,12 @@ dmesg > "${LOG_DIR}/dmesg.out"
if [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
echo saving coverage data...
+
+ # Ensure debugfs is mounted
+ if ! test -d /sys/kernel/debug/gcov; then
+ mount -t debugfs debugfs /sys/kernel/debug 2>/dev/null || true
+ fi
+
(set +x; cd /sys/kernel/debug/gcov; find ./* -name '*.gcda' | \
while read -r f
do
@@ -218,7 +231,7 @@ if [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
echo running gcovr...
gcovr -s --html-details --gcov-executable "$GCOV_CMD" --gcov-ignore-parse-errors \
- -o "${COVR_DIR}/gcovr" "${ksrc_dir}/net/rds/"
+ --root "${ksrc_dir}" -o "${COVR_DIR}/gcovr" "${ksrc_dir}/net/rds/"
else
echo "Coverage report will be skipped"
fi
--
2.25.1
next prev parent reply other threads:[~2026-04-27 23:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 23:29 [PATCH net-next v1 0/6] selftests: rds: Log collection, TAP compliance and cleanups Allison Henderson
2026-04-27 23:29 ` [PATCH net-next v1 1/6] selftests: rds: Increase selftest timeout Allison Henderson
2026-04-27 23:29 ` [PATCH net-next v1 2/6] selftests: rds: Update USAGE string for run.sh Allison Henderson
2026-04-27 23:29 ` [PATCH net-next v1 3/6] selftests: rds: Add timeout flag to run.sh Allison Henderson
2026-04-27 23:29 ` Allison Henderson [this message]
2026-04-27 23:29 ` [PATCH net-next v1 5/6] selftests: rds: Collect pcaps on timeout Allison Henderson
2026-04-27 23:29 ` [PATCH net-next v1 6/6] selftests: rds: Make rds selftests TAP compliant Allison Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260427232927.2712755-5-achender@kernel.org \
--to=achender@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox