[igt-dev] [PATCH i-g-t v5 3/3] tests/pm_sseu: adapt debugfs parsing for newer kernels

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Feb 26 17:59:20 UTC 2018


We introduced a subslice mask storage per slice in newer kernels
(because of the possibility of asymmetry). As a result the debugfs
output has changed a bit.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 tests/pm_sseu.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/tests/pm_sseu.c b/tests/pm_sseu.c
index 41e1c9fa..abd89d28 100644
--- a/tests/pm_sseu.c
+++ b/tests/pm_sseu.c
@@ -104,6 +104,14 @@ dbg_get_status_section(const char *title, char **first, char **last)
 	*last = pos - 1;
 }
 
+static bool
+dbg_has_line(const char *first, const char *last, const char *name)
+{
+	char *pos = strstr(first, name);
+
+	return pos != NULL && pos < last;
+}
+
 static int
 dbg_get_int(const char *first, const char *last, const char *name)
 {
@@ -161,8 +169,13 @@ dbg_get_status(struct status *stat)
 		dbg_get_int(first, last, "Available Slice Total:");
 	stat->info.subslice_total =
 		dbg_get_int(first, last, "Available Subslice Total:");
-	stat->info.subslice_per =
-		dbg_get_int(first, last, "Available Subslice Per Slice:");
+	if (dbg_has_line(first, last, "Available Subslice Per Slice:")) {
+		stat->info.subslice_per =
+			dbg_get_int(first, last, "Available Subslice Per Slice:");
+	} else {
+		stat->info.subslice_per =
+			dbg_get_int(first, last, "Available Slice0 subslices:");
+	}
 	stat->info.eu_total =
 		dbg_get_int(first, last, "Available EU Total:");
 	stat->info.eu_per =
@@ -182,8 +195,13 @@ dbg_get_status(struct status *stat)
 		dbg_get_int(first, last, "Enabled Slice Total:");
 	stat->hw.subslice_total =
 		dbg_get_int(first, last, "Enabled Subslice Total:");
-	stat->hw.subslice_per =
-		dbg_get_int(first, last, "Enabled Subslice Per Slice:");
+	if (dbg_has_line(first, last, "Enabled Subslice Per Slice:")) {
+		stat->hw.subslice_per =
+			dbg_get_int(first, last, "Enabled Subslice Per Slice:");
+	} else {
+		stat->hw.subslice_per =
+			dbg_get_int(first, last, "Enabled Slice0 subslices:");
+	}
 	stat->hw.eu_total =
 		dbg_get_int(first, last, "Enabled EU Total:");
 	stat->hw.eu_per =
-- 
2.16.1



More information about the igt-dev mailing list