public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t v2 1/1] tools/intel_guc_logger: Send GuC log level in new i915 expected format
Date: Fri, 12 Jan 2018 19:29:41 +0530	[thread overview]
Message-ID: <1515765581-26635-1-git-send-email-sagar.a.kamble@intel.com> (raw)

i915 expects GuC log level to be specified as:
	0: disabled
	1: enabled (verbosity level 0 = min)
	2: enabled (verbosity level 1)
	3: enabled (verbosity level 2)
	4: enabled (verbosity level 3 = max)

Remove the earlier internal layout based logging control from
guc_log_control and send new expected values.

v2: log_level assert in guc_log_control, cleaner level setup (Michal)
added missing copyright header. (Sagar)

Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 tools/intel_guc_logger.c | 41 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/tools/intel_guc_logger.c b/tools/intel_guc_logger.c
index 031fd84..5f1de8d 100644
--- a/tools/intel_guc_logger.c
+++ b/tools/intel_guc_logger.c
@@ -1,3 +1,26 @@
+/*
+ * Copyright © 2014-2018 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
 
 #include <inttypes.h>
 #include <stdio.h>
@@ -51,17 +74,27 @@ uint32_t test_duration, max_filesize;
 pthread_cond_t underflow_cond, overflow_cond;
 bool stop_logging, discard_oldlogs, capturing_stopped;
 
-static void guc_log_control(bool enable_logging)
+static void guc_log_control(bool enable, uint32_t log_level)
 {
 	int control_fd;
 	char data[19];
 	uint64_t val;
 	int ret;
 
+	igt_assert_lte(log_level, 3);
+
 	control_fd = igt_debugfs_open(-1, CONTROL_FILE_NAME, O_WRONLY);
 	igt_assert_f(control_fd >= 0, "couldn't open the guc log control file\n");
 
-	val = enable_logging ? ((verbosity_level << 4) | 0x1) : 0;
+	/*
+	 * i915 expects GuC log level to be specified as:
+	 * 0: disabled
+	 * 1: enabled (verbosity level 0 = min)
+	 * 2: enabled (verbosity level 1)
+	 * 3: enabled (verbosity level 2)
+	 * 4: enabled (verbosity level 3 = max)
+	 */
+	val = enable ? log_level + 1 : 0;
 
 	ret = snprintf(data, sizeof(data), "0x%" PRIx64, val);
 	igt_assert(ret > 2 && ret < sizeof(data));
@@ -288,7 +321,7 @@ static void init_main_thread(void)
 	/* Enable the logging, it may not have been enabled from boot and so
 	 * the relay file also wouldn't have been created.
 	 */
-	guc_log_control(true);
+	guc_log_control(true, verbosity_level);
 
 	open_relay_file();
 	open_output_file();
@@ -420,7 +453,7 @@ int main(int argc, char **argv)
 	} while (!stop_logging);
 
 	/* Pause logging on the GuC side */
-	guc_log_control(false);
+	guc_log_control(false, 0);
 
 	/* Signal flusher thread to make an exit */
 	capturing_stopped = 1;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2018-01-12 14:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 13:59 Sagar Arun Kamble [this message]
2018-01-12 14:24 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/1] tools/intel_guc_logger: Send GuC log level in new i915 expected format Patchwork
2018-01-12 16:01 ` ✗ Fi.CI.IGT: failure " 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=1515765581-26635-1-git-send-email-sagar.a.kamble@intel.com \
    --to=sagar.a.kamble@intel.com \
    --cc=intel-gfx@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