Skip to contentSkip to conversation

tests/debugfs_test: Pretty print subdirectories

PATCH In review Maarten Lankhorst 3 participants 4 messages Nov 2, 2017 – Nov 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/debugfs_test: Pretty print subdirectories

Instead of:

(debugfs_test:1499) DEBUG: Reading file "data"
(debugfs_test:1499) DEBUG: Could not open file "data" with error: Input/output error

Print:

(debugfs_test:1360) DEBUG: Entering subdir crtc-2
(debugfs_test:1360) DEBUG: Entering subdir crc

(debugfs_test:1360) DEBUG:              Reading file "data"
(debugfs_test:1360) DEBUG:              Could not open file "data" with error: Input/output error
(debugfs_test:1360) DEBUG:              Reading file "control"
---
 tests/debugfs_test.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)
tests/debugfs_test.c +18 -7
index ae38ba077df6..268d6e78fdc1 100644
@@ -27,10 +27,18 @@
 #include <sys/types.h>
 #include <dirent.h>
 
-static void read_and_discard_sysfs_entries(int path_fd)
+static void read_and_discard_sysfs_entries(int path_fd, int indent)
 {
 	struct dirent *dirent;
 	DIR *dir;
+	char tabs[8];
+	int i;
+
+	igt_assert(indent < sizeof(tabs) - 1);
+
+	for (i = 0; i < indent; i++)
+		tabs[i] = '\t';
+	tabs[i] = '\0';
 
 	dir = fdopendir(path_fd);
 	if (!dir)
@@ -45,7 +53,8 @@ static void read_and_discard_sysfs_entries(int path_fd)
 			igt_assert((sub_fd =
 				    openat(path_fd, dirent->d_name, O_RDONLY |
 					   O_DIRECTORY)) > 0);
-			read_and_discard_sysfs_entries(sub_fd);
+			igt_debug("%sEntering subdir %s\n", tabs, dirent->d_name);
+			read_and_discard_sysfs_entries(sub_fd, indent + 1);
 			close(sub_fd);
 		} else {
 			char buf[512];
@@ -53,11 +62,12 @@ static void read_and_discard_sysfs_entries(int path_fd)
 			ssize_t ret;
 
 			igt_set_timeout(5, "reading sysfs entry");
-			igt_debug("Reading file \"%s\"\n", dirent->d_name);
+			igt_debug("%sReading file \"%s\"\n", tabs, dirent->d_name);
 
 			sub_fd = openat(path_fd, dirent->d_name, O_RDONLY);
 			if (sub_fd == -1) {
-				igt_debug("Could not open file \"%s\" with error: %m\n", dirent->d_name);
+				igt_debug("%sCould not open file \"%s\" with error: %m\n",
+					  tabs, dirent->d_name);
 				continue;
 			}
 
@@ -66,7 +76,8 @@ static void read_and_discard_sysfs_entries(int path_fd)
 			} while (ret == sizeof(buf));
 
 			if (ret == -1)
-				igt_debug("Could not read file \"%s\" with error: %m\n", dirent->d_name);
+				igt_debug("%sCould not read file \"%s\" with error: %m\n",
+					  tabs, dirent->d_name);
 
 			igt_reset_timeout();
 			close(sub_fd);
@@ -121,7 +132,7 @@ igt_main
 
 		igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
-		read_and_discard_sysfs_entries(debugfs);
+		read_and_discard_sysfs_entries(debugfs, 0);
 	}
 
 	igt_subtest("read_all_entries_display_off") {
@@ -137,7 +148,7 @@ igt_main
 
 		igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
-		read_and_discard_sysfs_entries(debugfs);
+		read_and_discard_sysfs_entries(debugfs, 0);
 	}
 
 	igt_subtest("emon_crash") {
Signature · 6 lines
2.14.1

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

✓ Fi.CI.BAT: success for tests/debugfs_test: Pretty print subdirectories

== Series Details ==

== Series Details ==

Series: tests/debugfs_test: Pretty print subdirectories
URL : https://patchwork.freedesktop.org/series/33045/
State : success

== Summary ==

IGT patchset tested on top of latest successful build 6d16875736b9fb1ebf4bf3dc5a941f9e431d58e0 lib/igt_debugfs: Remove support for legacy CRC api.

with latest DRM-Tip kernel build CI_DRM_3309
fca2506bc5d4 drm-tip: 2017y-11m-02d-13h-10m-58s UTC integration manifest

No testlist changes.

Test chamelium:

        Subgroup dp-crc-fast:
                fail       -> PASS       (fi-kbl-7500u) fdo#102514
Test kms_cursor_legacy:
        Subgroup basic-flip-before-cursor-varying-size:
                skip       -> PASS       (fi-hsw-4770r)
Test kms_frontbuffer_tracking:
        Subgroup basic:
                fail       -> PASS       (fi-glk-dsi) fdo#103167
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                dmesg-warn -> PASS       (fi-skl-6700k) fdo#103546 +1

fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103546 https://bugs.freedesktop.org/show_bug.cgi?id=103546

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:448s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:457s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:382s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:540s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:278s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:502s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:507s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:512s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:489s
fi-cfl-s         total:289  pass:253  dwarn:4   dfail:0   fail:0   skip:32  time:556s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:607s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:429s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:269s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:582s
fi-glk-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:492s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:430s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:430s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:429s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:503s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:465s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:495s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:575s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:479s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:584s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:576s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:452s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:598s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:647s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:522s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:506s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:465s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:572s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:429s

== Logs ==

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

#2 lore raw

✗ Fi.CI.IGT: warning for tests/debugfs_test: Pretty print subdirectories

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: tests/debugfs_test: Pretty print subdirectories
URL : https://patchwork.freedesktop.org/series/33045/
State : warning

== Summary ==

Test drv_module_reload:

        Subgroup basic-no-display:
                pass       -> DMESG-WARN (shard-hsw) fdo#102707 +1
Test kms_busy:
        Subgroup extended-modeset-hang-newfb-with-reset-render-A:
                pass       -> DMESG-WARN (shard-hsw)
        Subgroup extended-modeset-hang-oldfb-with-reset-render-A:
                dmesg-warn -> PASS       (shard-hsw)
Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test kms_frontbuffer_tracking:
        Subgroup fbc-rgb565-draw-blt:
                pass       -> SKIP       (shard-hsw)
        Subgroup fbc-1p-primscrn-cur-indfb-draw-mmap-wc:
                pass       -> SKIP       (shard-hsw)

fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

shard-hsw total:2539 pass:1429 dwarn:2 dfail:0 fail:9 skip:1099 time:9297s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_466/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 Maarten Lankhorst
Quoted 7 lines · Maarten Lankhorst

Instead of:

(debugfs_test:1499) DEBUG: Reading file "data"
(debugfs_test:1499) DEBUG: Could not open file "data" with error: Input/output error

Print:

Quoted 7 lines

(debugfs_test:1360) DEBUG: Entering subdir crtc-2
(debugfs_test:1360) DEBUG: Entering subdir crc

(debugfs_test:1360) DEBUG:              Reading file "data"
(debugfs_test:1360) DEBUG:              Could not open file "data" with error: Input/output error
(debugfs_test:1360) DEBUG:              Reading file "control"

and pushed, since the test results are clean on this binary.

Thanks!

Signature · 6 lines
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx