[igt-dev] [PATCH i-g-t 1/7] tools/intel_guc_logger: Adjust the tool to work with log modparam changes

Michał Winiarski michal.winiarski at intel.com
Tue Feb 27 12:58:58 UTC 2018


Since:
35fe703c3161 ("drm/i915/guc: Change values for i915_guc_log_control")

We're using sane guc_log_level modparam values. Let's reflect that in
the logger tool.

Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
---
 tools/intel_guc_logger.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/intel_guc_logger.c b/tools/intel_guc_logger.c
index 031fd84d..1edc7991 100644
--- a/tools/intel_guc_logger.c
+++ b/tools/intel_guc_logger.c
@@ -42,7 +42,7 @@ char *out_filename;
 int poll_timeout = 2; /* by default 2ms timeout */
 pthread_mutex_t mutex;
 pthread_t flush_thread;
-int verbosity_level = 3; /* by default capture logs at max verbosity */
+int verbosity_level = 4; /* by default capture logs at max verbosity */
 uint32_t produced, consumed;
 uint64_t total_bytes_written;
 int num_buffers = NUM_SUBBUFS;
@@ -61,7 +61,7 @@ static void guc_log_control(bool enable_logging)
 	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;
+	val = enable_logging ? verbosity_level : 0;
 
 	ret = snprintf(data, sizeof(data), "0x%" PRIx64, val);
 	igt_assert(ret > 2 && ret < sizeof(data));
@@ -301,7 +301,7 @@ static int parse_options(int opt, int opt_index, void *data)
 	switch(opt) {
 	case 'v':
 		verbosity_level = atoi(optarg);
-		igt_assert_f(verbosity_level >= 0 && verbosity_level <= 3, "invalid input for -v option\n");
+		igt_assert_f(verbosity_level >= 0 && verbosity_level <= 4, "invalid input for -v option\n");
 		igt_debug("verbosity level to be used is %d\n", verbosity_level);
 		break;
 	case 'o':
@@ -353,7 +353,7 @@ static void process_command_line(int argc, char **argv)
 	};
 
 	const char *help =
-		"  -v --verbosity=level   verbosity level of GuC logging (0-3)\n"
+		"  -v --verbosity=level   verbosity level of GuC logging\n"
 		"  -o --outputfile=name   name of the output file, including the location, where logs will be stored\n"
 		"  -b --buffers=num       number of buffers to be maintained on logger side for storing logs\n"
 		"  -t --testduration=sec  max duration in seconds for which the logger should run\n"
-- 
2.14.3



More information about the igt-dev mailing list