[PATCH i-g-t 1/2] tests/intel/xe_debugfs: Extend gt test to check mocs entry
Kumar, Janga Rahul
janga.rahul.kumar at intel.com
Wed Apr 24 20:19:33 UTC 2024
> -----Original Message-----
> From: Roper, Matthew D <matthew.d.roper at intel.com>
> Sent: Saturday, March 23, 2024 2:48 AM
> To: Kumar, Janga Rahul <janga.rahul.kumar at intel.com>
> Cc: igt-dev at lists.freedesktop.org; Gandi, Ramadevi
> <ramadevi.gandi at intel.com>
> Subject: Re: [PATCH i-g-t 1/2] tests/intel/xe_debugfs: Extend gt test to check
> mocs entry
>
> On Thu, Mar 21, 2024 at 08:46:36PM +0530, janga.rahul.kumar at intel.com
> wrote:
> > From: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> >
> > Read and dump mocs debugfs entry.
> >
> > Cc: Matt Roper <matthew.d.roper at intel.com>
> > Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar at intel.com>
> > ---
> > tests/intel/xe_debugfs.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/tests/intel/xe_debugfs.c b/tests/intel/xe_debugfs.c index
> > c5a586e9b..ba12f6ccc 100644
> > --- a/tests/intel/xe_debugfs.c
> > +++ b/tests/intel/xe_debugfs.c
> > @@ -158,6 +158,7 @@ test_gt(int fd, int gt_id)
> > "topology",
> > "sa_info",
> > "hw_engines",
> > + "mocs",
> > // "force_reset"
> > };
> > static const char * const expected_files_uc[] = { @@ -183,6 +184,10
> > @@ test_gt(int fd, int gt_id)
> > igt_assert(igt_debugfs_exists(fd, name, O_RDONLY));
> > igt_debugfs_dump(fd, name);
> >
> > + sprintf(name, "gt%d/mocs", gt_id);
> > + igt_assert(igt_debugfs_exists(fd, name, O_RDONLY));
> > + igt_debugfs_dump(fd, name);
>
> Rather than just dumping the contents to the log should we do some very basic
> sanity checks (e.g., make sure that the values don't come back as all 0's for
> every entry)?
@Roper, Matthew D, I have tried checking for some basic sanity . To check any mocs entry is "0" or not based on the debugfs output format.
Made below changes. During testing I have observed that test was failing on few platforms. In some platforms few entries are 0.
To ensure not all values are 0's we can count the number of 0 occurances and compare it with the mocs entries for that platform but it is not maintenance friendly we might need to update the test for every new platform. This test ensure that the debugfs is created or not.
We do have self test to check the correctness of register values with mocs entries. Debugfs dump is generated by reading registers so if there is any wrong register state it will be caught via selftest.
Code change:
#include "xe/xe_query.h"
+#define INVALID_MOCS_VALUE "( 0x0)"
struct {
bool warn_on_not_hit;
} opt = { 0 };
@@ -186,6 +188,7 @@ test_gt(int fd, int gt_id)
sprintf(name, "gt%d/mocs", gt_id);
igt_assert(igt_debugfs_exists(fd, name, O_RDONLY));
+ igt_assert(!igt_debugfs_search(fd, name, INVALID_MOCS_VALUE));
igt_debugfs_dump(fd, name);
Thanks,
Rahul
>
>
> Matt
>
> > +
> > sprintf(name, "gt%d/uc/guc_info", gt_id);
> > igt_assert(igt_debugfs_exists(fd, name, O_RDONLY));
> > igt_debugfs_dump(fd, name);
> > --
> > 2.25.1
> >
>
> --
> Matt Roper
> Graphics Software Engineer
> Linux GPU Platform Enablement
> Intel Corporation
More information about the igt-dev
mailing list