From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Subject: [PATCH i-g-t v2 8/8] tests/core_hotunplug: Print info between steps
Date: Mon, 5 Aug 2024 16:37:11 +0200 [thread overview]
Message-ID: <20240805143713.76034-9-kamil.konieczny@linux.intel.com> (raw)
In-Reply-To: <20240805143713.76034-1-kamil.konieczny@linux.intel.com>
There are some info printed directly into kernel dmesg before
subtest steps. Turn comment before steps into direct prints
to stdout to help differentiate which steps where a success
and where it starts failing.
Fixed also one misspelling s/realoading/reloading/
Signed-off-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
---
tests/core_hotunplug.c | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 51edee985..415c74381 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -184,12 +184,13 @@ static void prepare(struct hotunplug *priv)
igt_assert_fd(priv->fd.sysfs_bus);
priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev);
+ igt_info("Preparations done\n");
}
-/* Unbind the driver from the device */
static void driver_unbind(struct hotunplug *priv, const char *prefix,
int timeout)
{
+ igt_info("Unbind the driver from the device (bus: %s)\n", priv->dev_bus_addr);
/*
* FIXME: on some devices, the audio driver (snd_hda_intel)
* binds into the i915 driver. On such hardware, kernel warnings
@@ -216,11 +217,13 @@ static void driver_unbind(struct hotunplug *priv, const char *prefix,
igt_assert_f(faccessat(priv->fd.sysfs_drv, priv->dev_bus_addr, F_OK, 0),
"Unbound device still present (%s)\n", priv->dev_bus_addr);
+
+ igt_info("Unbind done\n");
}
-/* Re-bind the driver to the device */
static void driver_bind(struct hotunplug *priv, int timeout)
{
+ igt_info("Re-bind the driver to the device (bus: %s)\n", priv->dev_bus_addr);
local_debug("%s\n", "rebinding the driver to the device");
priv->failure = "Driver re-bind failure!";
@@ -235,17 +238,19 @@ static void driver_bind(struct hotunplug *priv, int timeout)
"Rebound device not present (%s)!\n", priv->dev_bus_addr);
if (priv->snd_driver) {
- igt_info("Realoading %s\n", priv->snd_driver);
+ igt_info("Reloading %s\n", priv->snd_driver);
igt_kmod_load(priv->snd_driver, NULL);
free(priv->snd_driver);
priv->snd_driver = NULL;
}
+
+ igt_info("Re-bind done\n");
}
-/* Remove (virtually unplug) the device from its bus */
static void device_unplug(struct hotunplug *priv, const char *prefix,
int timeout)
{
+ igt_info("Remove (virtually unplug) the device from its bus (%s)\n", priv->dev_bus_addr);
igt_require(priv->fd.sysfs_dev == -1);
/*
@@ -267,7 +272,8 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
O_DIRECTORY);
igt_assert_fd(priv->fd.sysfs_dev);
- local_debug("%sunplugging the device\n", prefix);
+ igt_info("%sunplugging the device %s\n", prefix, priv->dev_bus_addr);
+ local_debug("%sunplugging the device %s\n", prefix, priv->dev_bus_addr);
priv->failure = "Device unplug failure!";
igt_set_timeout(timeout, "Device unplug timeout!");
@@ -280,11 +286,13 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
igt_assert_f(faccessat(priv->fd.sysfs_bus, priv->dev_bus_addr, F_OK, 0),
"Unplugged device still present (%s)\n", priv->dev_bus_addr);
+
+ igt_info("Unplug done\n");
}
-/* Re-discover the device by rescanning its bus */
static void bus_rescan(struct hotunplug *priv, int timeout)
{
+ igt_info("Re-discover the device by rescanning its bus (%s)\n", priv->dev_bus_addr);
local_debug("%s\n", "rediscovering the device");
priv->failure = "Bus rescan failure!";
@@ -303,6 +311,8 @@ static void bus_rescan(struct hotunplug *priv, int timeout)
free(priv->snd_driver);
priv->snd_driver = NULL;
}
+
+ igt_info("Bus rescan done\n");
}
static void cleanup(struct hotunplug *priv)
@@ -317,6 +327,7 @@ static void cleanup(struct hotunplug *priv)
}
priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev);
+ igt_info("Cleanup done\n");
}
static bool local_i915_is_wedged(int i915)
@@ -498,6 +509,8 @@ static bool healthcheck(struct hotunplug *priv, bool recover)
node_healthcheck(priv,
FLAG_RENDER | (recover ? FLAG_RECOVER : 0));
+ igt_info("Healthcheck: %s\n", priv->failure ? "failed" : "ok");
+
return !priv->failure;
}
@@ -532,6 +545,7 @@ static void recover(struct hotunplug *priv)
else if (faccessat(priv->fd.sysfs_drv, priv->dev_bus_addr, F_OK, 0))
driver_bind(priv, 60);
+ igt_info("Recovery: %s\n", priv->failure ? "failed" : "ok");
if (priv->failure)
igt_assert_f(healthcheck(priv, true), "%s\n", priv->failure);
}
--
2.43.0
next prev parent reply other threads:[~2024-08-05 14:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 14:37 [PATCH i-g-t v2 0/8] tests/core_hotunplug: Make it fail only once Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 1/8] lib/drmtest: add function for retriving chipset Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 2/8] tests/core_hotunplug: set known chipset before tests Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 3/8] lib/drmtest: Allow to get drm device name Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 4/8] tests/core_hotunplug: Open the same driver Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 5/8] tests/core_hotunplug: Fix device close Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 6/8] tests/core_hotunplug: Skip if no render available Kamil Konieczny
2024-08-05 14:37 ` [PATCH i-g-t v2 7/8] tests/core_hotunplug: Check health once after subtest Kamil Konieczny
2024-08-07 12:26 ` Andrzej Hajda
2024-08-05 14:37 ` Kamil Konieczny [this message]
2024-08-07 12:58 ` [PATCH i-g-t v2 8/8] tests/core_hotunplug: Print info between steps Andrzej Hajda
2024-08-05 15:20 ` ✓ CI.xeBAT: success for tests/core_hotunplug: Make it fail only once Patchwork
2024-08-05 15:31 ` ✓ Fi.CI.BAT: " Patchwork
2024-08-05 16:25 ` ✗ CI.xeFULL: failure " Patchwork
2024-08-05 18:45 ` Kamil Konieczny
2024-08-05 23:51 ` ✗ Fi.CI.IGT: " Patchwork
2024-08-06 12:51 ` Kamil Konieczny
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=20240805143713.76034-9-kamil.konieczny@linux.intel.com \
--to=kamil.konieczny@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/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