summaryrefslogtreecommitdiff
path: root/udev/udevd.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-07-17 13:24:37 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-07-17 13:26:46 +0200
commit820fc48f249012c673eb38f63dd8b5ee039627d0 (patch)
treedf616a5c70021173949d0606133c113ded9cdf20 /udev/udevd.c
parent9528405c4ac1defb8dc48f2095d971c978de5bb1 (diff)
udevd: add timestamp to --debug output
Diffstat (limited to 'udev/udevd.c')
-rw-r--r--udev/udevd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/udev/udevd.c b/udev/udevd.c
index 2cdc18b41e..69d509ce91 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -31,6 +31,7 @@
#include <time.h>
#include <getopt.h>
#include <dirent.h>
+#include <sys/time.h>
#include <sys/prctl.h>
#include <sys/socket.h>
#include <sys/signalfd.h>
@@ -53,8 +54,15 @@ static void log_fn(struct udev *udev, int priority,
const char *format, va_list args)
{
if (debug) {
- fprintf(stderr, "[%d] %s: ", (int) getpid(), fn);
- vfprintf(stderr, format, args);
+ char buf[1024];
+ struct timeval tv;
+ struct timezone tz;
+
+ vsnprintf(buf, sizeof(buf), format, args);
+ gettimeofday(&tv, &tz);
+ fprintf(stderr, "%llu.%06u [%u] %s: %s",
+ (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec,
+ (int) getpid(), fn, buf);
} else {
vsyslog(priority, format, args);
}
@@ -266,6 +274,7 @@ static void worker_new(struct event *event)
struct worker_message msg;
int err;
+ info(event->udev, "seq %llu running\n", udev_device_get_seqnum(dev));
udev_event = udev_event_new(dev);
if (udev_event == NULL)
_exit(3);