Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Senna Tschudin <peter.senna@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Peter Senna Tschudin" <peter.senna@linux.intel.com>,
	"Helen Koike" <helen.koike@collabora.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Jani Saarinen" <jani.saarinen@intel.com>,
	"Janusz Krzysztofik" <janusz.krzysztofik@linux.intel.com>,
	"Juha-Pekka Heikkila" <juha-pekka.heikkila@intel.com>,
	"Kamil Konieczny" <kamil.konieczny@linux.intel.com>,
	"Lucas De Marchi" <lucas.demarchi@intel.com>,
	"Maíra Canal" <mcanal@igalia.com>,
	"Melissa Wen" <mwen@igalia.com>,
	"Petri Latvala" <adrinael@adrinael.net>,
	"Rob Clark" <robdclark@chromium.org>,
	"Ryszard Knop" <ryszard.knop@intel.com>,
	"Swati Sharma" <swati2.sharma@intel.com>,
	"Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
	dominik.karol.piatkowski@intel.com,
	himal.prasad.ghimiray@intel.com, katarzyna.piecielska@intel.com,
	luciano.coelho@intel.com, nirmoy.das@intel.com,
	stuart.summers@intel.com
Subject: [PATCH i-g-t v12 0/3] igt_facts for fact tracking
Date: Thu, 12 Dec 2024 08:15:24 +0100	[thread overview]
Message-ID: <20241212071527.64595-1-peter.senna@linux.intel.com> (raw)
In-Reply-To: <136a49f8-8173-47a8-ac5d-e62e972e1005@linux.intel.com>

igt_facts is a library that tracks facts about the system and reports
changes to the facts. This is useful for tracking changes in the
system configuration that may affect the test results.

The patch series adds the library, unit testing, the lsfacts tool and
make changes to igt_runner to use the library. For igt_runner the facts
are disabled by default. To enable them use the command line argument
-f or --facts.

Here's 3 reasons why igt_facts seem useful:

  - CI itself performs some of these checks in the pipelines (loaded
    modules, kernel taints before testing starts, likely more in the
    future), so this could simplify fetching this data if we just
    parsed the IGT lsfacts output.

  - Simplicity: allows for quick examination of runner logs,
    identifying successful tests and isolating those that left the
    system tainted or caused the GPU to drop off the bus. This enables
    efficient filtering of relevant logs to pinpoint issues near
    reported fact changes. While this information could also be derived
    from dmesg outputs or standard error logs, igt_facts is more
    straightforward and convenient, particularly for non-kernel
    developers tasked with review and debugging.

  - It also makes it easier to notice passing tests that leave the
    system in an unclean state.

Here is an example of the output of igt_runner when using igt_facts:

  [229.606139] [FACT before any test] new: hardware.pci.gpu_at_addr.0000:03:00.0: 8086:e20b Intel Battlemage (Gen20)
  [229.606305] [FACT before any test] new: kernel.is_tainted.taint_warn: true
  [229.608841] [001/267] (600s left) xe_module_load (load)
  [229.641224] Starting subtest: load
  [230.613328] Subtest load: SUCCESS (0.973s)
  [230.678868] [FACT xe_module_load (load)] new: hardware.pci.drm_card_at_addr.0000:03:00.0: card0
  [230.680801] [FACT xe_module_load (load)] new: kernel.kmod_is_loaded.xe: true

v12:
 - split the patch in 3
 - updated comment style on .h files
 - updated module list to be closer to lib/drmtest.c and to
   include a comment mentioning lib/drmtest.c
 - Added a configuration struct to track the command line argument
   and udev status.
 - Add mechanism to disable udev to prevent error message spamming
   when udev is not available.
 - runner/executor: moved the call to igt_facts_lists_init() to after
   dry run check.
 - moved variable definitions from igt_facts.h to igt_facts.c
 - added #ifndef guards to igt_facts.h
 - removed double new lines
 - updated comment style that were still using //

v11:
 - fix typo

v10:
 - fix memory leaks from asprintf (Thank you Dominik Karol!)
 - fix comments for consistency (Thank you Dominik Karol!)

v9:
 - do not report new hardware when loading/unloading kmod changes the
   string of the GPU name. I accidentally reintroduced this issue
   when refactoring to use linked lists.
 - add tools/lsfacts: 9 lines of code that print either the facts or
   that no facts were found.
 - fix code comments describing functions
 - fix white space issues

v8:
 - fix white space issues

v7:
 - refactor to use linked lists provided by igt_lists
 - Added function arguments to code comments
 - updated commit message

v6:
 - sort includes in igt_facts.c alphabetically
 - add facts for kernel taints using igt_kernel_tainted() and
   igt_explain_taints()

v5:
 - fix the broken patch format from v4

v4:
 - fix a bug on delete_fact()
 - drop glib and calls to g_ functions
 - change commit message to indicate that report only on fact changes
 - use consistent format for reporting changes
 - fix SPDX header format

v3:
 - refreshed commit message
 - changed format SPDX string
 - removed license text
 - replace last_test assignment when null by two ternary operators
 - added function descriptions following example found elsewhere in
   the code
 - added igt_assert to catch failures to realloc()

v2:
 - add lib/tests/igt_facts.c for basic unit testing
 - bugfix: do not report a new gpu when the driver changes the gpu name
 - bugfix: do not report the pci_id twice on the gpu name

CC: Helen Koike <helen.koike@collabora.com>
CC: Jani Nikula <jani.nikula@linux.intel.com>
CC: Jani Saarinen <jani.saarinen@intel.com>
CC: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
CC: Juha-Pekka Heikkila <juha-pekka.heikkila@intel.com>
CC: Kamil Konieczny <kamil.konieczny@linux.intel.com>
CC: Lucas De Marchi <lucas.demarchi@intel.com>
CC: Maíra Canal <mcanal@igalia.com>
CC: Melissa Wen <mwen@igalia.com>
CC: Petri Latvala <adrinael@adrinael.net>
CC: Rob Clark <robdclark@chromium.org>
CC: Ryszard Knop <ryszard.knop@intel.com>
CC: Swati Sharma <swati2.sharma@intel.com>
CC: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
CC: dominik.karol.piatkowski@intel.com
CC: himal.prasad.ghimiray@intel.com
CC: igt-dev@lists.freedesktop.org <igt-dev@lists.freedesktop.org>
CC: katarzyna.piecielska@intel.com
CC: luciano.coelho@intel.com
CC: nirmoy.das@intel.com
CC: stuart.summers@intel.com

Peter Senna Tschudin (3):
  lib/igt_facts: Library and unit testing for fact tracking
  tools/lsfacts: Add tool for listing facts
  runner/executor: Integrate igt_facts functionality

 lib/igt_facts.c       | 800 ++++++++++++++++++++++++++++++++++++++++++
 lib/igt_facts.h       |  47 +++
 lib/meson.build       |   1 +
 lib/tests/igt_facts.c |  21 ++
 lib/tests/meson.build |   1 +
 runner/executor.c     |  10 +
 runner/settings.c     |   9 +-
 tools/lsfacts.c       |  30 ++
 tools/meson.build     |   1 +
 9 files changed, 919 insertions(+), 1 deletion(-)
 create mode 100644 lib/igt_facts.c
 create mode 100644 lib/igt_facts.h
 create mode 100644 lib/tests/igt_facts.c
 create mode 100644 tools/lsfacts.c

-- 
2.34.1


  parent reply	other threads:[~2024-12-12  7:16 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02 11:37 [PATCH i-g-t] igt-runner fact checking Peter Senna Tschudin
2024-11-04 19:27 ` ✓ CI.xeBAT: success for " Patchwork
2024-11-05  5:09 ` [PATCH i-g-t] " Peter Senna Tschudin
2024-11-05  8:18 ` ✗ CI.xeFULL: failure for " Patchwork
2024-11-06  9:28 ` [PATCH i-g-t v2] " Peter Senna Tschudin
2024-11-06 12:44   ` Kamil Konieczny
2024-11-07  7:03     ` Peter Senna Tschudin
2024-11-07 17:44       ` Kamil Konieczny
2024-11-06 11:15 ` ✗ Fi.CI.BAT: failure for igt-runner fact checking (rev2) Patchwork
2024-11-06 11:23 ` ✓ CI.xeBAT: success " Patchwork
2024-11-06 14:13 ` [PATCH i-g-t] igt-runner fact checking Lucas De Marchi
2024-11-07  6:57 ` [PATCH i-g-t v3] " Peter Senna Tschudin
2024-11-07  7:13 ` ✗ GitLab.Pipeline: warning for igt-runner fact checking (rev3) Patchwork
2024-11-07  7:18 ` [PATCH i-g-t] igt-runner fact checking Peter Senna Tschudin
2024-11-07 15:55   ` Lucas De Marchi
2024-11-07 17:48     ` Peter Senna Tschudin
2024-11-07 19:29       ` Lucas De Marchi
2024-11-08  5:30         ` Peter Senna Tschudin
2024-11-08 16:24           ` Lucas De Marchi
2024-11-08  1:15     ` Knop, Ryszard
2024-11-08  6:51       ` Peter Senna Tschudin
2024-11-08 13:41         ` Knop, Ryszard
2024-11-07  7:26 ` ✓ CI.xeBAT: success for igt-runner fact checking (rev3) Patchwork
2024-11-07  7:30 ` [PATCH i-g-t v3] igt-runner fact checking Peter Senna Tschudin
2024-11-07 17:39   ` Kamil Konieczny
2024-11-07  7:51 ` ✓ Fi.CI.BAT: success for igt-runner fact checking (rev3) Patchwork
2024-11-07  8:40 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-11-07 13:21 ` ✗ CI.xeFULL: failure for igt-runner fact checking (rev2) Patchwork
2024-11-08 12:54 ` ✗ CI.xeFULL: failure for igt-runner fact checking (rev3) Patchwork
2024-11-09  7:15 ` [PATCH i-g-t v4] igt-runner fact checking Peter Senna Tschudin
2024-11-09  7:46 ` [PATCH i-g-t v5] " Peter Senna Tschudin
2024-11-09  8:33 ` ✓ Fi.CI.BAT: success for igt-runner fact checking (rev5) Patchwork
2024-11-09  8:36 ` ✗ CI.xeBAT: failure " Patchwork
2024-11-11  5:55   ` Peter Senna Tschudin
2024-11-09  9:33 ` ✗ Fi.CI.IGT: " Patchwork
2024-11-11  5:54   ` Peter Senna Tschudin
2024-11-10  5:09 ` ✗ CI.xeFULL: " Patchwork
2024-11-11  5:53   ` Peter Senna Tschudin
2024-11-18  8:24 ` [PATCH i-g-t v6] igt-runner fact checking Peter Senna Tschudin
2024-11-18 13:07   ` Luca Coelho
2024-11-18 16:03     ` Peter Senna Tschudin
2024-11-19  8:19       ` Luca Coelho
2024-11-19 10:07         ` Peter Senna Tschudin
2024-11-19 10:24           ` Luca Coelho
2024-11-20  6:09             ` Peter Senna Tschudin
2024-11-18 20:45 ` ✓ CI.xeBAT: success for igt-runner fact checking (rev6) Patchwork
2024-11-18 21:00 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-11-19  5:31   ` Peter Senna Tschudin
2024-11-19  5:08 ` ✗ CI.xeFULL: " Patchwork
2024-11-19  6:15   ` Peter Senna Tschudin
2024-11-21 12:35 ` [PATCH i-g-t v7] igt-runner fact checking Peter Senna Tschudin
2024-11-21 14:22 ` [PATCH i-g-t v8] " Peter Senna Tschudin
2024-11-25  9:49   ` Zbigniew Kempczyński
2024-11-25 10:21     ` Peter Senna Tschudin
2024-11-25 11:32       ` Zbigniew Kempczyński
2024-11-21 20:48 ` ✓ Xe.CI.BAT: success for igt-runner fact checking (rev8) Patchwork
2024-11-21 20:57 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-22  6:36   ` Peter Senna Tschudin
2024-11-22  8:08     ` Illipilli, TejasreeX
2024-11-22  8:06 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-22  8:11 ` ✗ Xe.CI.Full: failure " Patchwork
2024-11-22  8:27   ` Peter Senna Tschudin
2024-11-25  7:15   ` Peter Senna Tschudin
2024-11-25  7:20     ` Musial, Ewelina
2024-11-25  7:27       ` Musial, Ewelina
2024-11-25 10:54         ` Illipilli, TejasreeX
2024-11-24 15:01 ` ✗ i915.CI.Full: " Patchwork
2024-11-25  6:57   ` Peter Senna Tschudin
2024-11-25 10:54     ` Illipilli, TejasreeX
2024-11-25 10:39 ` ✓ i915.CI.Full: success " Patchwork
2024-11-29  7:08 ` [PATCH i-g-t v9] igt-runner fact checking Peter Senna Tschudin
2024-12-04 13:17   ` Piatkowski, Dominik Karol
2024-11-29  7:45 ` ✓ Xe.CI.BAT: success for igt-runner fact checking (rev9) Patchwork
2024-11-29  8:07 ` ✗ i915.CI.BAT: failure " Patchwork
2024-11-29  8:16   ` Peter Senna Tschudin
2024-11-29 13:48     ` Illipilli, TejasreeX
2024-11-29 13:42 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-29 17:26 ` ✗ Xe.CI.Full: failure " Patchwork
2024-12-02  5:01   ` Peter Senna Tschudin
2024-11-29 17:28 ` ✗ i915.CI.Full: " Patchwork
2024-12-02  5:07   ` Peter Senna Tschudin
2024-12-03  6:43     ` Illipilli, TejasreeX
2024-12-02 14:29 ` ✓ i915.CI.Full: success " Patchwork
2024-12-05  4:54 ` [PATCH i-g-t v10] igt-runner fact checking Peter Senna Tschudin
2024-12-05  9:08   ` Piatkowski, Dominik Karol
2024-12-06 11:42   ` Kamil Konieczny
2024-12-06 13:16     ` Peter Senna Tschudin
2024-12-06 16:46       ` Kamil Konieczny
2024-12-05  5:41 ` ✓ i915.CI.BAT: success for igt-runner fact checking (rev10) Patchwork
2024-12-05  6:07 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-05  6:58 ` ✗ i915.CI.Full: failure " Patchwork
2024-12-05  8:15   ` Peter Senna Tschudin
2024-12-05 13:01     ` Illipilli, TejasreeX
2024-12-05  8:02 ` ✗ Xe.CI.Full: " Patchwork
2024-12-05  8:35   ` Peter Senna Tschudin
2024-12-05 10:51 ` [PATCH i-g-t v11] igt-runner fact checking Peter Senna Tschudin
2024-12-09 10:53   ` Zbigniew Kempczyński
2024-12-09 17:16     ` Kamil Konieczny
2024-12-10 12:00     ` Knop, Ryszard
2024-12-10 14:14   ` Knop, Ryszard
2024-12-05 12:59 ` ✓ i915.CI.Full: success for igt-runner fact checking (rev10) Patchwork
2024-12-12  7:15 ` Peter Senna Tschudin [this message]
2024-12-12  7:15   ` [PATCH i-g-t v12 1/3] lib/igt_facts: Library and unit testing for fact tracking Peter Senna Tschudin
2024-12-12 16:19     ` Zbigniew Kempczyński
2024-12-12  7:15   ` [PATCH i-g-t v12 2/3] tools/lsfacts: Add tool for listing facts Peter Senna Tschudin
2024-12-12 16:20     ` Zbigniew Kempczyński
2024-12-12  7:15   ` [PATCH i-g-t v12 3/3] runner/executor: Integrate igt_facts functionality Peter Senna Tschudin
2024-12-12 16:23     ` Zbigniew Kempczyński
2024-12-12 17:33     ` Kamil Konieczny
2024-12-12  8:16 ` ✓ Xe.CI.BAT: success for igt-runner fact checking (rev12) Patchwork
2024-12-12  8:43 ` ✓ i915.CI.BAT: " Patchwork
2024-12-12 12:57 ` ✗ i915.CI.Full: failure " Patchwork
2024-12-12 14:30 ` ✗ Xe.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241212071527.64595-1-peter.senna@linux.intel.com \
    --to=peter.senna@linux.intel.com \
    --cc=adrinael@adrinael.net \
    --cc=dominik.karol.piatkowski@intel.com \
    --cc=helen.koike@collabora.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jani.saarinen@intel.com \
    --cc=janusz.krzysztofik@linux.intel.com \
    --cc=juha-pekka.heikkila@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=katarzyna.piecielska@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=luciano.coelho@intel.com \
    --cc=mcanal@igalia.com \
    --cc=mwen@igalia.com \
    --cc=nirmoy.das@intel.com \
    --cc=robdclark@chromium.org \
    --cc=ryszard.knop@intel.com \
    --cc=stuart.summers@intel.com \
    --cc=swati2.sharma@intel.com \
    --cc=zbigniew.kempczynski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox