Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Joshi, Kunal1" <kunal1.joshi@intel.com>
To: Pranay Samala <pranay.samala@intel.com>, igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, sameer.lattannavar@intel.com
Subject: Re: [i-g-t,v3,1/5] lib/igt_sysfs: Usage of Original debug mask to read/reset
Date: Wed, 23 Apr 2025 17:19:56 +0530	[thread overview]
Message-ID: <6c33666f-8d7d-4ec1-8f08-ebc671960c8c@intel.com> (raw)
In-Reply-To: <20250401092015.818465-2-pranay.samala@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2155 bytes --]

Hello Pranay,

Please find comments inline,

On 01-04-2025 14:50, Pranay Samala wrote:
> Original debug mask holds the mask before the test and will be
> used to reset the debug mask post test.
>
> 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 | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
> index 2e4c2ee63..9643aab43 100644
> --- a/lib/igt_sysfs.c
> +++ b/lib/igt_sysfs.c
> @@ -443,7 +443,7 @@ int igt_sysfs_drm_module_params_open(void)
>   	return open(path, O_RDONLY);
>   }
>   
> -static int log_level = -1;
> +static int original_debug_mask = -1;
>   
>   /**
>    * igt_drm_debug_level_get:
> @@ -458,8 +458,8 @@ int igt_drm_debug_level_get(int dir)
>   {
>   	char buf[20];
>   
> -	if (log_level >= 0)
> -		return log_level;
> +	if (original_debug_mask >= 0)
> +		return original_debug_mask;
Rename original_debug_mask to saved_drm_debug_mask for clarity that it's 
saved to be restored later.
>   
>   	if (igt_sysfs_read(dir, "debug", buf, sizeof(buf) - 1) < 0)
>   		return -1;
> @@ -479,15 +479,15 @@ void igt_drm_debug_level_reset(void)
>   	char buf[20];
>   	int dir;
>   
> -	if (log_level < 0)
> +	if (original_debug_mask < 0)
>   		return;
>   
>   	dir = igt_sysfs_drm_module_params_open();
>   	if (dir < 0)
>   		return;
>   
> -	igt_debug("Resetting DRM debug level to %d\n", log_level);
> -	snprintf(buf, sizeof(buf), "%d", log_level);
> +	igt_debug("Resetting DRM debug level to %d\n", original_debug_mask);

Change level to mask in igt_info


Thanks and Regards
Kunal Joshi

> +	snprintf(buf, sizeof(buf), "%d", original_debug_mask);
>   	igt_assert(igt_sysfs_set(dir, "debug", buf));
>   
>   	close(dir);
> @@ -513,8 +513,8 @@ void igt_drm_debug_level_update(unsigned int new_log_level)
>   	if (dir < 0)
>   		return;
>   
> -	log_level = igt_drm_debug_level_get(dir);
> -	if (log_level < 0) {
> +	original_debug_mask = igt_drm_debug_level_get(dir);
> +	if (original_debug_mask < 0) {
>   		close(dir);
>   		return;
>   	}

[-- Attachment #2: Type: text/html, Size: 2759 bytes --]

  reply	other threads:[~2025-04-23 11:50 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   ` Joshi, Kunal1 [this message]
2025-04-01  9:20 ` [PATCH i-g-t v3 2/5] lib/igt_sysfs: Rename debug level APIs/variables to debug mask Pranay Samala
2025-04-23 11:56   ` [i-g-t,v3,2/5] " 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=6c33666f-8d7d-4ec1-8f08-ebc671960c8c@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@intel.com \
    --cc=pranay.samala@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