Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: zbigniew.kempczynski@intel.com, kamil.konieczny@linux.intel.com,
	michal.wajdeczko@intel.com
Subject: [PATCH i-g-t] lib/igt_device_scan: Skip attributes in subdirectories
Date: Thu,  4 Jul 2024 18:44:37 +0200	[thread overview]
Message-ID: <20240704164437.1543161-1-marcin.bernatowicz@linux.intel.com> (raw)

Skip attributes in subdirectories as they are not used for filtering.
This change improves speed and reduces the impact of non-DRM related
component bugs on testing, such as ASPM issues.

Rename function is_on_blacklist to is_on_blocklist to promote more
inclusive language.

Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
 lib/igt_device_scan.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lib/igt_device_scan.c b/lib/igt_device_scan.c
index 9a2da3d62..6473ca7ad 100644
--- a/lib/igt_device_scan.c
+++ b/lib/igt_device_scan.c
@@ -433,7 +433,7 @@ static enum dev_type __pci_devtype(uint16_t vendor, uint16_t device, const char
 /* Reading sysattr values can take time (even seconds),
  * we want to avoid reading such keys.
  */
-static bool is_on_blacklist(const char *what)
+static bool is_on_blocklist(const char *what)
 {
 	static const char *keys[] = { "config", "modalias", "modes",
 				      "resource",
@@ -442,16 +442,18 @@ static bool is_on_blacklist(const char *what)
 				      "resource0_wc", "resource1_wc", "resource2_wc",
 				      "resource3_wc", "resource4_wc", "resource5_wc",
 				      "uevent", NULL};
-	const char *key;
-	int i = 0;
+	const char **key;
 
 	if (what == NULL)
 		return false;
 
-	while ((key = keys[i++])) {
-		if (strcmp(key, what) == 0)
+	/* Skip attributes in subdirectories */
+	if (strchr(what, '/') != NULL)
+		return true;
+
+	for (key = keys; *key; key++)
+		if (strcmp(*key, what) == 0)
 			return true;
-	}
 
 	return false;
 
@@ -553,7 +555,7 @@ static void get_attrs(struct udev_device *dev, struct igt_device *idev)
 		const char *key = udev_list_entry_get_name(entry);
 		const char *value;
 
-		if (is_on_blacklist(key)) {
+		if (is_on_blocklist(key)) {
 			entry = udev_list_entry_get_next(entry);
 			continue;
 		}
-- 
2.31.1


             reply	other threads:[~2024-07-04 16:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-04 16:44 Marcin Bernatowicz [this message]
2024-07-04 18:51 ` ✓ CI.xeBAT: success for lib/igt_device_scan: Skip attributes in subdirectories Patchwork
2024-07-04 19:01 ` ✓ Fi.CI.BAT: " Patchwork
2024-07-05  0:27 ` ✗ CI.xeFULL: failure " Patchwork
2024-07-05  9:38   ` Bernatowicz, Marcin
2024-07-05  7:59 ` ✗ Fi.CI.IGT: " Patchwork
2024-07-05 10:08   ` Bernatowicz, Marcin
2024-07-08  6:58 ` [PATCH i-g-t] " Zbigniew Kempczyński
  -- strict thread matches above, loose matches on Subject: below --
2024-07-05 14:10 Marcin Bernatowicz
2024-07-08  7:00 ` Zbigniew Kempczyński

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=20240704164437.1543161-1-marcin.bernatowicz@linux.intel.com \
    --to=marcin.bernatowicz@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=michal.wajdeczko@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