From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Peter Senna Tschudin <peter.senna@linux.intel.com>,
lucas.demarchi@intel.com, rodrigo.vivi@intel.com,
kamil.konieczny@linux.intel.com, katarzyna.piecielska@intel.com,
zbigniew.kempczynski@intel.com, michal.wajdeczko@intel.com,
karthik.b.s@intel.com
Subject: [PATCH v4 i-g-t 2/6] tests: Add core_debugfs
Date: Mon, 7 Jul 2025 23:03:04 +0200 [thread overview]
Message-ID: <20250707210310.54861-3-peter.senna@linux.intel.com> (raw)
In-Reply-To: <20250707210310.54861-1-peter.senna@linux.intel.com>
Introduce core_debugfs that is expected to work with any GPU, not
limited to i915 and Xe. The test attempts to open every file in debugfs
associated with the GPU.
Cc: lucas.demarchi@intel.com
Cc: rodrigo.vivi@intel.com
Cc: kamil.konieczny@linux.intel.com
Cc: katarzyna.piecielska@intel.com
Cc: zbigniew.kempczynski@intel.com
Cc: michal.wajdeczko@intel.com
Cc: karthik.b.s@intel.com
Signed-off-by: Peter Senna Tschudin <peter.senna@linux.intel.com>
---
v4
- unchanged from v3
v3:
- removed "debugfs" from subtest name (Thanks Michal Wajdeczko)
v2:
- changed style of comparison to NULL
docs/code_coverage.md | 18 ++++----
scripts/code_cov_selftest.sh | 2 +-
tests/core_debugfs.c | 54 ++++++++++++++++++++++++
tests/intel-ci/fast-feedback.testlist | 1 +
tests/intel-ci/xe-fast-feedback.testlist | 1 +
tests/meson.build | 1 +
6 files changed, 67 insertions(+), 10 deletions(-)
create mode 100644 tests/core_debugfs.c
diff --git a/docs/code_coverage.md b/docs/code_coverage.md
index 031611e69..8c4857412 100644
--- a/docs/code_coverage.md
+++ b/docs/code_coverage.md
@@ -162,23 +162,23 @@ For each script, the igt_runner passes just one parameter: the results
directory + the test name.
For instance, if it is needed to run a test called
-`intel_sysfs_debugfs (i915-debugfs-read-all-entries)` using `code_cov_capture`
+`core_debugfs (read-all-entries)` using `code_cov_capture`
parameter, e. g.:
```
-$ echo "igt@intel_sysfs_debugfs@i915-debugfs-read-all-entries" > my.testlist
+$ echo "igt@core_debugfs@read-all-entries" > my.testlist
$ ./scripts/run-tests.sh -T my.testlist -k ~/linux -c code_cov_capture -P
Found test list: "/basedir/igt/build/tests/test-list.txt"
-[31410.499969] [1/1] intel_sysfs_debugfs (i915-debugfs-read-all-entries)
+[31410.499969] [1/1] core_debugfs (read-all-entries)
[31411.060446] Storing code coverage results...
-[31418.01] Code coverage wrote to /basedir/igt/results/code_cov/intel_sysfs_debugfs_i915_debugfs_read_all_entries.info
+[31418.01] Code coverage wrote to /basedir/igt/results/code_cov/core_debugfs_debugfs_read_all_entries.info
Done.
```
The script will be called as:
```
-code_cov_capture results/code_cov/intel_sysfs_debugfs_i915_debugfs_read_all_entries
+code_cov_capture results/code_cov/core_debugfs_debugfs_read_all_entries
```
Please notice that any character that it is not a number nor a letter at the
@@ -376,7 +376,7 @@ OUT_DIR="${HOME}/results"
mkdir -p $OUT_DIR/html
-echo "igt@intel_sysfs_debugfs@i915-debugfs-read-all-entries" > $TESTLIST
+echo "igt@core_debugfs@read-all-entries" > $TESTLIST
echo "igt@core_auth@basic-auth" >> $TESTLIST
echo "igt@gem_exec_basic@basic" >> $TESTLIST
@@ -401,8 +401,8 @@ genhtml -q -s --legend --branch-coverage $OUT_DIR/results.info
Running such script produces the following output:
```
-[3622.993304] [1/3] intel_sysfs_debugfs (i915-debugfs-read-all-entries)
-[3631.95] Code coverage wrote to results/code_cov/intel_sysfs_debugfs_i915_debugfs_read_all_entries.info
+[3622.993304] [1/3] core_debugfs (read-all-entries)
+[3631.95] Code coverage wrote to results/code_cov/core_debugfs_debugfs_read_all_entries.info
[3626.217016] Storing code coverage results...
[3631.957998] [2/3] core_auth (basic-auth)
[3638.03] Code coverage wrote to results/code_cov/core_auth_basic_auth.info
@@ -419,7 +419,7 @@ core_auth_basic_auth.info:
Ignored......: non-drm headers and source files where none of its code ran.
Source files.: 23.27% (165 of 709 total), 29.57% (165 of 558 filtered)
-intel_sysfs_debugfs_i915_debugfs_read_all_entries.info:
+core_debugfs_debugfs_read_all_entries.info:
lines......: 19.3% (20266 of 104802 lines)
functions..: 17.5% (1922 of 10971 functions)
branches...: 12.7% (9462 of 74555 branches)
diff --git a/scripts/code_cov_selftest.sh b/scripts/code_cov_selftest.sh
index bc5ef7458..6f3a6db55 100755
--- a/scripts/code_cov_selftest.sh
+++ b/scripts/code_cov_selftest.sh
@@ -13,7 +13,7 @@ if [ -z "$IGT_KERNEL_TREE" ] ; then
exit 1
fi
-TEST="igt@intel_sysfs_debugfs@i915-debugfs-read-all-entries"
+TEST="igt@core_debugfs@read-all-entries"
TESTLIST="my_tests.testlist"
GATHER="scripts/code_cov_gather_on_test.py"
diff --git a/tests/core_debugfs.c b/tests/core_debugfs.c
new file mode 100644
index 000000000..97fd446c5
--- /dev/null
+++ b/tests/core_debugfs.c
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2025 Intel Corporation
+ */
+
+#include "igt.h"
+#include "igt_debugfs.h"
+#include "igt_dir.h"
+
+/**
+ * TEST: debugfs test
+ * Description: Read entries from debugfs
+ * Category: Core
+ * Mega feature: General Core features
+ * Sub-category: uapi
+ * Functionality: debugfs
+ * Feature: core
+ * Test category: uapi
+ *
+ * SUBTEST: read-all-entries
+ * Description: Read all entries from debugfs path validating debugfs entries
+ */
+
+IGT_TEST_DESCRIPTION("Read entries from debugfs");
+
+igt_main
+{
+ int debugfs = -1;
+ int fd = -1;
+ igt_dir_t *igt_dir = NULL;
+
+ igt_fixture {
+ fd = drm_open_driver_master(DRIVER_ANY);
+ debugfs = igt_debugfs_dir(fd);
+ igt_require(debugfs >= 0);
+
+ igt_dir = igt_dir_create(debugfs);
+ igt_require(igt_dir);
+
+ kmstest_set_vt_graphics_mode();
+ }
+
+ igt_describe("Read all entries from debugfs path.");
+ igt_subtest("read-all-entries") {
+ igt_dir_scan_dirfd(igt_dir, -1);
+ igt_dir_process_files(igt_dir, NULL, NULL);
+ }
+
+ igt_fixture {
+ igt_dir_destroy(igt_dir);
+ close(debugfs);
+ drm_close_driver(fd);
+ }
+}
diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index 82395e7ea..3ec1b95cf 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -3,6 +3,7 @@ igt@i915_module_load@load
# Keep alphabetically sorted by default
igt@core_auth@basic-auth
+igt@core_debugfs@read-all-entries
igt@fbdev@eof
igt@fbdev@info
igt@fbdev@nullptr
diff --git a/tests/intel-ci/xe-fast-feedback.testlist b/tests/intel-ci/xe-fast-feedback.testlist
index d9d180d87..ac3177ae9 100644
--- a/tests/intel-ci/xe-fast-feedback.testlist
+++ b/tests/intel-ci/xe-fast-feedback.testlist
@@ -7,6 +7,7 @@ igt@fbdev@nullptr
igt@fbdev@read
igt@fbdev@write
+igt@core_debugfs@read-all-entries
igt@intel_sysfs_debugfs@xe-base
igt@intel_sysfs_debugfs@xe-debugfs-read-all-entries
igt@intel_sysfs_debugfs@xe-forcewake
diff --git a/tests/meson.build b/tests/meson.build
index 9b87a0d24..99d7d95be 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -1,5 +1,6 @@
test_progs = [
'core_auth',
+ 'core_debugfs',
'core_getclient',
'core_getstats',
'core_getversion',
--
2.43.0
next prev parent reply other threads:[~2025-07-07 21:03 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 7:42 [PATCH v3 resend i-g-t 0/6] Replace intel_sysfs_debugfs Peter Senna Tschudin
2025-06-16 7:42 ` [PATCH v3 resend i-g-t 1/6] lib/igt_dir: Directory processing and flexible file handling Peter Senna Tschudin
2025-06-24 13:24 ` Sokolowski, Jan
2025-06-16 7:42 ` [PATCH v3 resend i-g-t 2/6] tests: Add core_debugfs Peter Senna Tschudin
2025-06-16 7:42 ` [PATCH v3 resend i-g-t 3/6] tests: Add core_debugfs_heads_power Peter Senna Tschudin
2025-07-03 20:39 ` Rodrigo Vivi
2025-07-04 8:06 ` Peter Senna Tschudin
2025-07-04 10:01 ` Karthik B S
2025-07-04 11:36 ` Kamil Konieczny
2025-07-04 10:02 ` Karthik B S
2025-06-16 7:42 ` [PATCH v3 resend i-g-t 4/6] tests: Add core_sysfs Peter Senna Tschudin
2025-06-16 7:42 ` [PATCH v3 resend i-g-t 5/6] tests: Add xe_debugfs Peter Senna Tschudin
2025-07-03 20:36 ` Rodrigo Vivi
2025-07-04 8:57 ` Peter Senna Tschudin
2025-07-04 9:06 ` Peter Senna Tschudin
2025-07-07 14:43 ` Rodrigo Vivi
2025-06-16 7:42 ` [PATCH v3 resend i-g-t 6/6] tests/intel: Remove intel_sysfs_debugfs Peter Senna Tschudin
2025-07-03 20:39 ` Rodrigo Vivi
2025-06-16 19:50 ` ✓ Xe.CI.BAT: success for Replace intel_sysfs_debugfs Patchwork
2025-06-17 2:49 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-17 13:01 ` ✗ i915.CI.BAT: " Patchwork
2025-07-03 21:44 ` ✓ Xe.CI.BAT: success for Replace intel_sysfs_debugfs (rev2) Patchwork
2025-07-03 21:45 ` ✓ i915.CI.BAT: " Patchwork
2025-07-04 4:29 ` ✗ i915.CI.Full: failure " Patchwork
2025-07-05 14:40 ` ✓ Xe.CI.Full: success " Patchwork
2025-07-07 21:03 ` [PATCH v4 i-g-t 0/6] Replace intel_sysfs_debugfs Peter Senna Tschudin
2025-07-07 21:03 ` [PATCH v4 i-g-t 1/6] lib/igt_dir: Directory processing and flexible file handling Peter Senna Tschudin
2025-07-07 21:03 ` Peter Senna Tschudin [this message]
2025-07-07 21:03 ` [PATCH v4 i-g-t 3/6] tests: Add kms_debugfs Peter Senna Tschudin
2025-07-07 21:03 ` [PATCH v4 i-g-t 4/6] tests: Add core_sysfs Peter Senna Tschudin
2025-07-07 21:03 ` [PATCH v4 i-g-t 5/6] tests: Add xe_debugfs Peter Senna Tschudin
2025-07-07 21:03 ` [PATCH v4 i-g-t 6/6] tests/intel: Remove intel_sysfs_debugfs Peter Senna Tschudin
-- strict thread matches above, loose matches on Subject: below --
2025-07-07 21:07 [PATCH v4 i-g-t 0/6] Replace intel_sysfs_debugfs Peter Senna Tschudin
2025-07-07 21:07 ` [PATCH v4 i-g-t 2/6] tests: Add core_debugfs Peter Senna Tschudin
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=20250707210310.54861-3-peter.senna@linux.intel.com \
--to=peter.senna@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=karthik.b.s@intel.com \
--cc=katarzyna.piecielska@intel.com \
--cc=lucas.demarchi@intel.com \
--cc=michal.wajdeczko@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=zbigniew.kempczynski@intel.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