Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mohammed Thasleem <mohammed.thasleem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2] tests/kms_atomic_transition: Lower drm log level to avoid exceeding disk usage limit
Date: Thu, 17 Aug 2023 21:08:55 +0530	[thread overview]
Message-ID: <20230817153855.12335-1-mohammed.thasleem@intel.com> (raw)
In-Reply-To: <20230718215950.2557-1-mohammed.thasleem@intel.com>

From: "Thasleem, Mohammed" <mohammed.thasleem@intel.com>

Set drm debug log level for DP messages and DRIVER messages to fix
exceeding disk usage limit in modeset-transition test cases.

v2: -Rename DEBUG_LEVEL to DRM_DEBUG_LEVEL.
    -Declared log level globally.
    -Added check for checking default log level before update.

Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
---
 tests/kms_atomic_transition.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
index a470eb88c..0f50a6ed1 100644
--- a/tests/kms_atomic_transition.c
+++ b/tests/kms_atomic_transition.c
@@ -27,9 +27,11 @@
  */
 #include "igt.h"
 #include "igt_rand.h"
+#include "igt_sysfs.h"
 #include "drmtest.h"
 #include "sw_sync.h"
 #include <errno.h>
+#include <fcntl.h>
 #include <pthread.h>
 #include <stdbool.h>
 #include <stdio.h>
@@ -44,13 +46,17 @@
 #define DRM_CAP_CURSOR_HEIGHT 0x9
 #endif
 
+#define DRM_DEBUG_LEVEL "/sys/module/drm/parameters/"
+#define LOG_LEVEL 0xa
+
 struct plane_parms {
 	struct igt_fb *fb;
 	uint32_t width, height, mask;
 };
 
 typedef struct {
-	int drm_fd;
+	int drm_fd, sysfs_fd;
+	uint32_t old_drm_log_level;
 	struct igt_fb fbs[2], argb_fb, sprite_fb;
 	igt_display_t display;
 	bool extended;
@@ -1065,6 +1071,9 @@ static void run_modeset_transition(data_t *data, int requested_outputs, bool non
 	int num_outputs = 0;
 	enum pipe pipe;
 
+	if (data->old_drm_log_level > LOG_LEVEL)
+		igt_sysfs_set_u32(data->sysfs_fd, "debug", LOG_LEVEL);
+
 	for_each_pipe(&data->display, pipe) {
 		igt_output_t *output;
 
@@ -1207,6 +1216,9 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 
 		igt_display_require_output(&data.display);
 
+		igt_require((data.sysfs_fd = open(DRM_DEBUG_LEVEL, O_RDONLY)) >= 0);
+		data.old_drm_log_level = igt_sysfs_get_u32(data.sysfs_fd, "debug");
+
 		for_each_connected_output(&data.display, output)
 			count++;
 	}
@@ -1281,6 +1293,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
 	}
 
 	igt_fixture {
+		igt_sysfs_set_u32(data.sysfs_fd, "debug", data.old_drm_log_level);
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);
 	}
-- 
2.25.1

  parent reply	other threads:[~2023-08-17 15:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-18 21:59 [igt-dev] [PATCH i-g-t] tests/kms_atomic_transition: Lower drm log level to avoid exceeding disk usage limit Thasleem, Mohammed
2023-07-18 22:16 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2023-07-18 22:36 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-07-18 22:50 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-07-25 16:20 ` [igt-dev] [PATCH i-g-t] " Kamil Konieczny
2023-08-17 15:38 ` Mohammed Thasleem [this message]
2023-08-17 15:47 ` [igt-dev] [PATCH i-g-t v2] " Mohammed Thasleem
2023-08-17 16:06 ` [igt-dev] [PATCH i-g-t v3] " Mohammed Thasleem
2023-08-17 16:54 ` [igt-dev] [PATCH i-g-t v4] " Mohammed Thasleem
2023-08-17 17:47   ` Kamil Konieczny
2023-08-17 17:59   ` Modem, Bhanuprakash
2023-08-18  4:05   ` Modem, Bhanuprakash
2023-08-17 18:41 ` [igt-dev] ○ CI.xeBAT: info for tests/kms_atomic_transition: Lower drm log level to avoid exceeding disk usage limit (rev5) Patchwork
2023-08-17 18:43 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-08-18 12:21 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20230817153855.12335-1-mohammed.thasleem@intel.com \
    --to=mohammed.thasleem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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