Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Leo Li <sunpeng.li@amd.com>,
	Pranay Samala <pranay.samala@intel.com>,
	igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com, kunal1.joshi@intel.com,
	sameer.lattannavar@intel.com, "Wheeler,
	Daniel" <Daniel.Wheeler@amd.com>,
	Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>,
	Ashutosh Dixit <ashutosh.dixit@intel.com>
Subject: Re: [PATCH i-g-t] tests/kms_cursor_legacy: Reduce debug loglevel dynamically
Date: Mon, 10 Feb 2025 17:58:12 +0200	[thread overview]
Message-ID: <877c5x4wrv.fsf@intel.com> (raw)
In-Reply-To: <abf8b026-20b6-4566-9823-bb558deb97a7@amd.com>

On Mon, 10 Feb 2025, Leo Li <sunpeng.li@amd.com> wrote:
> Hi Pranay,
>
> This change can also increase log verbosity; we observe this with amdgpu.
> Details inline.
>
> On 2025-01-28 00:28, Pranay Samala wrote:
>> This test is getting killed due to exceeding disk usage
>> limit on CI environment because its logging to many logs.
>> 
>> So dynamically reducing the debug log level to 10.
>> 
>> Signed-off-by: Pranay Samala <pranay.samala@intel.com>
>> ---
>>   tests/kms_cursor_legacy.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>> 
>> diff --git a/tests/kms_cursor_legacy.c b/tests/kms_cursor_legacy.c
>> index 1f082df2d..533972cd4 100644
>> --- a/tests/kms_cursor_legacy.c
>> +++ b/tests/kms_cursor_legacy.c
>> @@ -40,6 +40,7 @@
>>   #include "igt_psr.h"
>>   #include "igt_rand.h"
>>   #include "igt_stats.h"
>> +#include "igt_sysfs.h"
>>   
>>   /**
>>    * SUBTEST: %s-%s
>> @@ -1840,6 +1841,7 @@ igt_main
>>   	};
>>   
>>   	igt_fixture {
>> +		int dir, current_log_level;
>>   		display.drm_fd = drm_open_driver_master(DRIVER_ANY);
>>   		kmstest_set_vt_graphics_mode();
>>   
>> @@ -1850,6 +1852,15 @@ igt_main
>>   		 * fetch is enabled, so switching PSR1 for this whole test.
>>   		 */
>>   		intel_psr2_restore = i915_psr2_sel_fetch_to_psr1(display.drm_fd, NULL);
>> +
>> +		dir = igt_sysfs_drm_module_params_open();
>> +		if (dir >= 0) {
>> +			current_log_level = igt_drm_debug_level_get(dir);
>> +			close(dir);
>> +
>> +			if (current_log_level > 10)
>> +				igt_drm_debug_level_update(10);
>
> Isn't the DRM debug mask a bitmask?
> https://elixir.bootlin.com/linux/v6.13.1/source/include/drm/drm_print.h#L97
>
> So setting 10 isn't guaranteed to reduce verbosity, depending on how the DRM
> driver uses the various drm_* debug prints.

Ugh. Yes.

> What is guaranteed to reduce verbosity is to unset unwanted bits. Maybe that is
> the better approach?
>
> For example, instead of
> `if (current_log_level > 10)`,
>
> Do
>
> `igt_drm_debug_level_update(current_log_level & !(DRM_UT_CORE | ...);`

Ditto for commit a2ab0ec12ef4 ("tests/kms_atomic_transition: Reducing
debug loglevel dynamically"). It got to v6 and nobody noticed?

Ditto for commit 56b91193b825 ("lib/igt_sysfs: Implement dynamic
adjustment of debug log level") adding the whole thing. It should not be
referred to as "level" because it has nothing to do with "level". It
also makes no sense to print it out in decimal; hex makes more sense.


BR,
Jani.


>
> Thanks,
> Leo
>
>> +		}
>>   	}
>>   
>>   	igt_describe("Test checks how many cursor updates we can fit between vblanks "
>

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-02-10 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28  5:28 [PATCH i-g-t] tests/kms_cursor_legacy: Reduce debug loglevel dynamically Pranay Samala
2025-01-28  6:55 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-01-28  7:00 ` ✗ i915.CI.BAT: failure " Patchwork
2025-01-28  7:30 ` [PATCH i-g-t] " Dandamudi, Priyanka
2025-01-28 18:19 ` ✗ Xe.CI.Full: failure for " Patchwork
2025-02-10 15:11 ` [PATCH i-g-t] " Leo Li
2025-02-10 15:58   ` Jani Nikula [this message]
2025-02-19 14:39     ` Wheeler, Daniel
2025-02-20  7:00       ` Samala, Pranay

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=877c5x4wrv.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=Daniel.Wheeler@amd.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=juhapekka.heikkila@gmail.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=karthik.b.s@intel.com \
    --cc=kunal1.joshi@intel.com \
    --cc=pranay.samala@intel.com \
    --cc=sameer.lattannavar@intel.com \
    --cc=sunpeng.li@amd.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