Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pranay Samala <pranay.samala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, kunal1.joshi@intel.com,
	sameer.lattannavar@intel.com, pranay.samala@intel.com
Subject: [PATCH i-g-t v3 2/5] lib/igt_sysfs: Rename debug level APIs/variables to debug mask
Date: Tue,  1 Apr 2025 14:50:12 +0530	[thread overview]
Message-ID: <20250401092015.818465-3-pranay.samala@intel.com> (raw)
In-Reply-To: <20250401092015.818465-1-pranay.samala@intel.com>

The debug log mask is a mask rather than level. Rename each level
occurance to mask.

Fixes: 56b91193b825 ("lib/igt_sysfs: Implement dynamic adjustment of debug log level")
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
 lib/igt_sysfs.c | 32 ++++++++++++++++----------------
 lib/igt_sysfs.h |  6 +++---
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 9643aab43..e6058a1dd 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -446,15 +446,15 @@ int igt_sysfs_drm_module_params_open(void)
 static int original_debug_mask = -1;
 
 /**
- * igt_drm_debug_level_get:
+ * igt_drm_debug_mask_get:
  *
- * This reads the current debug log level of the machine on
+ * This reads the current debug mask of the machine on
  * which the test is currently executing.
  *
  * Returns:
- * The current log level, or -1 on error.
+ * The current debug mask, or -1 on error.
  */
-int igt_drm_debug_level_get(int dir)
+int igt_drm_debug_mask_get(int dir)
 {
 	char buf[20];
 
@@ -468,13 +468,13 @@ int igt_drm_debug_level_get(int dir)
 }
 
 /**
- * igt_drm_debug_level_reset:
+ * igt_drm_debug_mask_reset:
  *
- * This modifies the current debug log level of the machine
+ * This modifies the current debug mask of the machine
  * to the default value post-test.
  *
  */
-void igt_drm_debug_level_reset(void)
+void igt_drm_debug_mask_reset(void)
 {
 	char buf[20];
 	int dir;
@@ -486,25 +486,25 @@ void igt_drm_debug_level_reset(void)
 	if (dir < 0)
 		return;
 
-	igt_debug("Resetting DRM debug level to %d\n", original_debug_mask);
+	igt_debug("Resetting DRM debug mask to %d\n", original_debug_mask);
 	snprintf(buf, sizeof(buf), "%d", original_debug_mask);
 	igt_assert(igt_sysfs_set(dir, "debug", buf));
 
 	close(dir);
 }
 
-static void igt_drm_debug_level_reset_exit_handler(int sig)
+static void igt_drm_debug_mask_reset_exit_handler(int sig)
 {
-	igt_drm_debug_level_reset();
+	igt_drm_debug_mask_reset();
 }
 
 /**
- * igt_drm_debug_level_update:
- * @debug_level: new debug level to set
+ * igt_drm_debug_mask_update:
+ * @debug_level: new debug mask to set
  *
- * This modifies the current drm debug log level to the new value.
+ * This modifies the current drm debug mask to the new value.
  */
-void igt_drm_debug_level_update(unsigned int new_log_level)
+void igt_drm_debug_mask_update(unsigned int new_log_level)
 {
 	char buf[20];
 	int dir;
@@ -513,13 +513,13 @@ void igt_drm_debug_level_update(unsigned int new_log_level)
 	if (dir < 0)
 		return;
 
-	original_debug_mask = igt_drm_debug_level_get(dir);
+	original_debug_mask = igt_drm_debug_mask_get(dir);
 	if (original_debug_mask < 0) {
 		close(dir);
 		return;
 	}
 
-	igt_debug("Setting DRM debug level to %d\n", new_log_level);
+	igt_debug("Setting DRM debug mask to %d\n", new_log_level);
 	snprintf(buf, sizeof(buf), "%d", new_log_level);
 	igt_assert(igt_sysfs_set(dir, "debug", buf));
 
diff --git a/lib/igt_sysfs.h b/lib/igt_sysfs.h
index 86345f3d1..2f4d25bf6 100644
--- a/lib/igt_sysfs.h
+++ b/lib/igt_sysfs.h
@@ -143,9 +143,9 @@ void igt_sysfs_set_boolean(int dir, const char *attr, bool value);
 void bind_fbcon(bool enable);
 void fbcon_blink_enable(bool enable);
 
-void igt_drm_debug_level_update(unsigned int new_log_level);
-void igt_drm_debug_level_reset(void);
-int igt_drm_debug_level_get(int dir);
+void igt_drm_debug_mask_update(unsigned int new_log_level);
+void igt_drm_debug_mask_reset(void);
+int igt_drm_debug_mask_get(int dir);
 int igt_sysfs_drm_module_params_open(void);
 
 /**
-- 
2.34.1


  parent reply	other threads:[~2025-04-01  9:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  9:20 [PATCH i-g-t v3 0/5] Refactor DRM Debug Severity Handling for Pranay Samala
2025-04-01  9:20 ` [PATCH i-g-t v3 1/5] lib/igt_sysfs: Usage of Original debug mask to read/reset Pranay Samala
2025-04-23 11:49   ` [i-g-t,v3,1/5] " Joshi, Kunal1
2025-04-01  9:20 ` Pranay Samala [this message]
2025-04-23 11:56   ` [i-g-t,v3,2/5] lib/igt_sysfs: Rename debug level APIs/variables to debug mask Joshi, Kunal1
2025-04-01  9:20 ` [PATCH i-g-t v3 3/5] lib/igt_sysfs: Update new debug mask requested by user Pranay Samala
2025-04-01  9:20 ` [PATCH i-g-t v3 4/5] tests/kms: Add parse_bitmask support for user Pranay Samala
2025-04-03 15:18   ` Jani Nikula
2025-04-23 12:23   ` [i-g-t,v3,4/5] " Joshi, Kunal1
2025-04-01  9:20 ` [PATCH i-g-t v3 5/5] lib/igt_sysfs: Move igt_exit_handler into test Pranay Samala
2025-04-01 10:04 ` [PATCH i-g-t v3 0/5] Refactor DRM Debug Severity Handling for Samala, Pranay
2025-04-01 12:24 ` ✗ i915.CI.BAT: failure for " Patchwork
2025-04-01 12:30 ` ✓ Xe.CI.BAT: success " Patchwork
2025-04-01 14:39 ` ✗ Xe.CI.Full: failure " Patchwork
2025-04-06 22:24 ` Patchwork

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=20250401092015.818465-3-pranay.samala@intel.com \
    --to=pranay.samala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=kunal1.joshi@intel.com \
    --cc=sameer.lattannavar@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