Commit 289202e8 authored by Lionel Landwerlin's avatar Lionel Landwerlin

tests/pm_sseu: adapt debugfs parsing for newer kernels

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.

v2: Add a comment on why we have a special case on subslice per slice
Signed-off-by: Lionel Landwerlin's avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 4ead0251
......@@ -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,14 @@ 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:");
/* Dealing with a change in 4.17. */
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 +196,14 @@ 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:");
/* Dealing with a change in 4.17. */
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 =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment