[PATCH i-g-t v14 resend 2/3] tools/lsfacts: Add tool for listing facts

Peter Senna Tschudin peter.senna at linux.intel.com
Mon Dec 16 15:14:19 UTC 2024


Report the facts that are present on the system or 'No facts found...'
if no facts are detected.

CC: Helen Koike <helen.koike at collabora.com>
CC: Jani Nikula <jani.nikula at linux.intel.com>
CC: Jani Saarinen <jani.saarinen at intel.com>
CC: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
CC: Juha-Pekka Heikkila <juha-pekka.heikkila at intel.com>
CC: Kamil Konieczny <kamil.konieczny at linux.intel.com>
CC: Lucas De Marchi <lucas.demarchi at intel.com>
CC: Maíra Canal <mcanal at igalia.com>
CC: Melissa Wen <mwen at igalia.com>
CC: Petri Latvala <adrinael at adrinael.net>
CC: Rob Clark <robdclark at chromium.org>
CC: Ryszard Knop <ryszard.knop at intel.com>
CC: Swati Sharma <swati2.sharma at intel.com>
CC: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
CC: dominik.karol.piatkowski at intel.com
CC: himal.prasad.ghimiray at intel.com
CC: katarzyna.piecielska at intel.com
CC: luciano.coelho at intel.com
CC: nirmoy.das at intel.com
CC: stuart.summers at intel.com
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Reviewed-by: Ryszard Knop <ryszard.knop at intel.com>
Reviewed-by: Dominik Karol Piątkowski <dominik.karol.piatkowski at intel.com>
Signed-off-by: Peter Senna Tschudin <peter.senna at linux.intel.com>
---
 tools/lsfacts.c   | 27 +++++++++++++++++++++++++++
 tools/meson.build |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 tools/lsfacts.c

diff --git a/tools/lsfacts.c b/tools/lsfacts.c
new file mode 100644
index 000000000..bbe77717a
--- /dev/null
+++ b/tools/lsfacts.c
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2024 Intel Corporation
+ */
+
+#include "igt.h"
+#include "igt_facts.h"
+
+/**
+ * SECTION:lsfacts
+ * @short_description: lsfacts
+ * @title: lsfacts
+ * @include: lsfacts.c
+ *
+ * # lsfacts
+ *
+ * Scan for igt-facts and print them on screen. Indicate if no facts are found.
+ */
+int main(int argc, char *argv[])
+{
+	igt_facts_lists_init();
+
+	igt_facts("lsfacts");
+
+	if (igt_facts_are_all_lists_empty())
+		igt_info("No facts found...\n");
+}
diff --git a/tools/meson.build b/tools/meson.build
index 38b04851c..511aec69e 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -42,6 +42,7 @@ tools_progs = [
 	'intel_gem_info',
 	'intel_gvtg_test',
 	'dpcd_reg',
+	'lsfacts',
 	'lsgpu',
 	'power',
 ]
-- 
2.34.1



More information about the igt-dev mailing list