mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Added a timestamp to the logging output by trace_io.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
493b98bf23
commit
8b6e8053b8
1 file changed
+7
-1
@@ -178,12 +178,18 @@ static void trace_io(const struct connection *conn,
|
||||
{
|
||||
char string[64];
|
||||
unsigned int i;
|
||||
time_t now;
|
||||
struct tm *tm;
|
||||
|
||||
if (tracefd < 0)
|
||||
return;
|
||||
|
||||
now = time(NULL);
|
||||
tm = localtime(&now);
|
||||
|
||||
write(tracefd, prefix, strlen(prefix));
|
||||
sprintf(string, " %p ", conn);
|
||||
sprintf(string, " %p %0d:%0d:%0d ", conn, tm->tm_hour, tm->tm_min,
|
||||
tm->tm_sec);
|
||||
write(tracefd, string, strlen(string));
|
||||
write(tracefd, sockmsg_string(data->hdr.msg.type),
|
||||
strlen(sockmsg_string(data->hdr.msg.type)));
|
||||
|
||||