mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
selftests: rds: Fix gcov collection
debugfs is not mounted automatically in a virtme-ng 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, which causes 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> Link: https://patch.msgid.link/20260504054143.4027538-10-achender@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ec91483634
commit
c8781c61fd
|
|
@ -215,6 +215,12 @@ fi
|
|||
|
||||
if [[ -n "$LOG_DIR" ]] && [ "$GENERATE_GCOV_REPORT" -eq 1 ]; then
|
||||
echo saving coverage data...
|
||||
|
||||
# Ensure debugfs is mounted before reading gcov data.
|
||||
if ! mountpoint -q /sys/kernel/debug 2>/dev/null; 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
|
||||
|
|
@ -223,7 +229,7 @@ if [[ -n "$LOG_DIR" ]] && [ "$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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user