* RFC: verbose output for udevadm settle
@ 2008-07-09 23:25 Marco d'Itri
2008-07-10 22:56 ` Kay Sievers
0 siblings, 1 reply; 2+ messages in thread
From: Marco d'Itri @ 2008-07-09 23:25 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 264 bytes --]
From time to time I get bugs about udevadm settle timeouts at boot time,
and usually they are quite hard to investigate for random users.
So I tought about being verbose about what is left in the queue when the
timeout is reached.
Please comment.
--
ciao,
Marco
[-- Attachment #2: settle_verbose_timeout --]
[-- Type: text/plain, Size: 1097 bytes --]
--- a/udevsettle.c
+++ b/udevsettle.c
@@ -31,10 +31,43 @@
#include "udev.h"
#include "udevd.h"
+#include "list.h"
#define DEFAULT_TIMEOUT 180
#define LOOP_PER_SECOND 20
+static void print_queue(const char *dir)
+{
+ LIST_HEAD(files);
+ struct name_entry *item;
+
+ if (add_matching_files(&files, dir, NULL) < 0)
+ return;
+
+ printf("\n\nAfter the udevsettle timeout, the events queue contains:\n\n");
+
+ list_for_each_entry(item, &files, node) {
+ char target[NAME_SIZE];
+ size_t len;
+ const char *filename = strrchr(item->name, '/');
+
+ if (filename == NULL)
+ continue;
+ filename++;
+ if (*filename == '\0')
+ continue;
+
+ len = readlink(item->name, target, sizeof(target));
+ if (len < 0)
+ continue;
+ target[len] = '\0';
+
+ printf("%s: %s\n", filename, target);
+ }
+
+ printf("\n\n");
+}
+
int udevsettle(int argc, char *argv[], char *envp[])
{
char queuename[PATH_SIZE];
@@ -97,6 +130,7 @@ int udevsettle(int argc, char *argv[], c
}
if (loop <= 0) {
info("timeout waiting for queue\n");
+ print_queue(queuename);
goto exit;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFC: verbose output for udevadm settle
2008-07-09 23:25 RFC: verbose output for udevadm settle Marco d'Itri
@ 2008-07-10 22:56 ` Kay Sievers
0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2008-07-10 22:56 UTC (permalink / raw)
To: linux-hotplug
On Thu, Jul 10, 2008 at 01:25, Marco d'Itri <md@linux.it> wrote:
> From time to time I get bugs about udevadm settle timeouts at boot time,
> and usually they are quite hard to investigate for random users.
> So I tought about being verbose about what is left in the queue when the
> timeout is reached.
> Please comment.
I've applied it. :)
Thanks,
Kay
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-10 22:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-09 23:25 RFC: verbose output for udevadm settle Marco d'Itri
2008-07-10 22:56 ` Kay Sievers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).