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

Chris Wilson chris at chris-wilson.co.uk
Wed Mar 7 19:14:22 UTC 2018


Quoting Lionel Landwerlin (2018-02-26 17:59:20)
> 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:");

Ok, matches the proposed patch.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

I didn't check why we don't care about the rest of the future array; I
assume that's a future problem.
-Chris


More information about the igt-dev mailing list