[igt-dev] [PATCH] igt_kmod: handle EPIPE on kmsg
Lucas De Marchi
lucas.demarchi at intel.com
Sat Sep 28 00:16:09 UTC 2019
If kmsg rotates due to a huge log, the read() will fail with EPIPE since
the seek() we did is not valid anymore. When we get an EPIPE, the kernel
will set our pointer to the last entry available, so just retry another
read.
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
lib/igt_kmod.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 01faca39..c3da4667 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -391,8 +391,15 @@ static void kmsg_dump(int fd)
if (r < 0) {
if (errno == EINTR)
continue;
+
+ if (errno == EPIPE) {
+ igt_warn("kmsg truncated: too many messages. You may want to increase log_buf_len in kmcdline\n");
+ continue;
+ }
+
if (errno != EAGAIN)
- igt_warn("kmsg truncated due to unknown error: %m\n");
+ igt_warn("kmsg truncated: unknown error (%m)\n");
+
break;
}
--
2.23.0
More information about the igt-dev
mailing list