Skip to contentSkip to conversation

tools/intel_guc_logger: Send GuC log level in new i915 expected format

PATCH Superseded Sagar Arun Kamble 3 participants 5 messages Jan 12, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/intel_guc_logger: Send GuC log level in new i915 expected format

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.

Cc Michal Wajdeczko <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>
---
 tools/intel_guc_logger.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
tools/intel_guc_logger.c +15 -6
index 031fd84..e695497 100644
@@ -51,18 +51,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;
+	uint64_t val = 0;
 	int ret;
 
+	/*
+	 * 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)
+	 */
+	if (enable)
+		val = log_level + 1;
+
 	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;
-
 	ret = snprintf(data, sizeof(data), "0x%" PRIx64, val);
 	igt_assert(ret > 2 && ret < sizeof(data));
 
@@ -288,7 +297,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 +429,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;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for series starting with [1/1] tools/intel_guc_logger: Send GuC log level in new i915 expected format

== Series Details ==

== Series Details ==

Series: series starting with [1/1] tools/intel_guc_logger: Send GuC log level in new i915 expected format
URL : https://patchwork.freedesktop.org/series/36384/
State : success

== Summary ==

IGT patchset tested on top of latest successful build d37369c7146a2ceb332592297d311d501c1c748e Revert "build: make meson more official" damage

with latest DRM-Tip kernel build CI_DRM_3623
dbc7615897f6 drm-tip: 2018y-01m-11d-16h-49m-38s UTC integration manifest

No testlist changes.

Test debugfs_test:

        Subgroup read_all_entries:
                fail       -> DMESG-FAIL (fi-elk-e7500) fdo#103989 +1
                incomplete -> PASS       (fi-snb-2520m) fdo#103713 +1
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (fi-kbl-r) fdo#104172 +1

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104172 https://bugs.freedesktop.org/show_bug.cgi?id=104172

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:420s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:426s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:375s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:499s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:281s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:487s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:490s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:473s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:462s
fi-elk-e7500     total:224  pass:168  dwarn:9   dfail:1   fail:0   skip:45 
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:516s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:399s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:401s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:413s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:465s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:467s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:499s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-kbl-r         total:288  pass:260  dwarn:1   dfail:0   fail:0   skip:27  time:505s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:576s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:434s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:515s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:535s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:497s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:494s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:431s
fi-snb-2520m     total:245  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:403s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:570s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:472s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_770/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✓ Fi.CI.IGT: success for series starting with [1/1] tools/intel_guc_logger: Send GuC log level in new i915 expected format

In reply to Sagar Arun Kamble
== Series Details ==

== Series Details ==

Series: series starting with [1/1] tools/intel_guc_logger: Send GuC log level in new i915 expected format
URL : https://patchwork.freedesktop.org/series/36384/
State : success

== Summary ==

Test kms_atomic_transition:

        Subgroup plane-all-modeset-transition-fencing:
                dmesg-warn -> PASS       (shard-hsw) fdo#102614
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test kms_flip:
        Subgroup flip-vs-panning-vs-hang:
                dmesg-warn -> PASS       (shard-snb) fdo#103821
Test gem_eio:
        Subgroup in-flight:
                dmesg-warn -> PASS       (shard-snb) fdo#104058
Test gem_tiled_swapping:
        Subgroup non-threaded:
                pass       -> INCOMPLETE (shard-hsw) fdo#104218
Test drv_suspend:
        Subgroup fence-restore-untiled-hibernate:
                skip       -> FAIL       (shard-hsw) fdo#103375

fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#103821 https://bugs.freedesktop.org/show_bug.cgi?id=103821
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#104218 https://bugs.freedesktop.org/show_bug.cgi?id=104218
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375

shard-hsw        total:2638 pass:1498 dwarn:1   dfail:0   fail:8   skip:1130 time:8963s
shard-snb        total:2713 pass:1311 dwarn:1   dfail:0   fail:10  skip:1391 time:7902s
Blacklisted hosts:
shard-apl        total:2713 pass:1686 dwarn:1   dfail:0   fail:25  skip:1001 time:13553s
shard-kbl        total:2689 pass:1793 dwarn:1   dfail:0   fail:24  skip:870 time:10366s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_770/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#3 lore raw
In reply to Sagar Arun Kamble
Quoted 7 lines · Sagar Arun Kamble

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)

Quoted 8 lines

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

Cc Michal Wajdeczko <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>

---

with small bikeshedding below...

Quoted 8 lines
 tools/intel_guc_logger.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
tools/intel_guc_logger.c +0 -0
index 031fd84..e695497 100644

tools/intel_guc_logger.c uint32_t test_duration, max_filesize; · line 58

Quoted 10 lines
tools/intel_guc_logger.c +2 -2
@@ -51,18 +51,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;
+	uint64_t val = 0;
 	int ret;

Btw, this shouldn't hurt:

	igt_assert_lte(log_level, 3);

tools/intel_guc_logger.c uint32_t test_duration, max_filesize; · line 70

Quoted 10 lines
tools/intel_guc_logger.c +10 -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)
+	 */
+	if (enable)
+		val = log_level + 1;

control = enable ? log_level + 1 : 0;

tools/intel_guc_logger.c uint32_t test_duration, max_filesize; · line 75

Quoted 7 lines
tools/intel_guc_logger.c +1 -2
+
 	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;
-
 	ret = snprintf(data, sizeof(data), "0x%" PRIx64, val);

Btw, I'm wondering why we didn't use "fprintf(control_fd, ...)" here

Quoted 10 lines
tools/intel_guc_logger.c +1 -1
 	igt_assert(ret > 2 && ret < sizeof(data));
@@ -288,7 +297,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();

tools/intel_guc_logger.c int main(int argc, char **argv) · line 433

Quoted 6 lines
tools/intel_guc_logger.c +1 -1
@@ -420,7 +429,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;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 12 lines · Michal Wajdeczko
Quoted 10 lines · Sagar Arun Kamble

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.

Quoted 7 lines
Quoted 5 lines
Cc Michal Wajdeczko <[email protected]>
Cc Daniele Ceraolo Spurio <[email protected]>
Cc Chris Wilson <[email protected]>

---

Thanks for the review. Will shared updated rev.

Quoted 24 lines

with small bikeshedding below...

Quoted 8 lines

 tools/intel_guc_logger.c | 21 +++++++++++++++------

 1 file changed, 15 insertions(+), 6 deletions(-)
tools/intel_guc_logger.c +0 -0
index 031fd84..e695497 100644

tools/intel_guc_logger.c uint32_t test_duration, max_filesize; · line 58

Quoted 10 lines
tools/intel_guc_logger.c +2 -2
@@ -51,18 +51,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;
+    uint64_t val = 0;
      int ret;

Btw, this shouldn't hurt:

Quoted 2 lines

    igt_assert_lte(log_level, 3);

Yes

Quoted 11 lines

tools/intel_guc_logger.c uint32_t test_duration, max_filesize; · line 70

Quoted 10 lines
tools/intel_guc_logger.c +10 -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)
+     */
+    if (enable)
+        val = log_level + 1;
Quoted 2 lines

control = enable ? log_level + 1 : 0;

Ok

Quoted 9 lines

tools/intel_guc_logger.c uint32_t test_duration, max_filesize; · line 75

Quoted 6 lines
tools/intel_guc_logger.c +1 -2
+
      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;
-
      ret = snprintf(data, sizeof(data), "0x%" PRIx64, val);

Btw, I'm wondering why we didn't use "fprintf(control_fd, ...)" here

I remember that using read instead of fread was optimization to speed up the buffering of logs. For consistency I believe write is used instead fwrite.

Quoted 8 lines
Quoted 8 lines
tools/intel_guc_logger.c +1 -1
      igt_assert(ret > 2 && ret < sizeof(data));
@@ -288,7 +297,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();
Quoted 8 lines

tools/intel_guc_logger.c int main(int argc, char **argv) · line 433

Quoted 8 lines
tools/intel_guc_logger.c +1 -1
      open_output_file();
@@ -420,7 +429,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;

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx