ia64/xen-unstable

changeset 7493:98c6c36ac444

Added a timestamp to the logging output by trace_io.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Mon Oct 24 14:12:42 2005 +0100 (2005-10-24)
parents e6591119fda0
children fdea4a967bc7 e47f04c55eb1 99ece3c06913
files tools/xenstore/xenstored_core.c
line diff
     1.1 --- a/tools/xenstore/xenstored_core.c	Mon Oct 24 14:11:07 2005 +0100
     1.2 +++ b/tools/xenstore/xenstored_core.c	Mon Oct 24 14:12:42 2005 +0100
     1.3 @@ -178,12 +178,18 @@ static void trace_io(const struct connec
     1.4  {
     1.5  	char string[64];
     1.6  	unsigned int i;
     1.7 +	time_t now;
     1.8 +	struct tm *tm;
     1.9  
    1.10  	if (tracefd < 0)
    1.11  		return;
    1.12  
    1.13 +	now = time(NULL);
    1.14 +	tm = localtime(&now);
    1.15 +
    1.16  	write(tracefd, prefix, strlen(prefix));
    1.17 -	sprintf(string, " %p ", conn);
    1.18 +	sprintf(string, " %p %0d:%0d:%0d ", conn, tm->tm_hour, tm->tm_min,
    1.19 +		tm->tm_sec);
    1.20  	write(tracefd, string, strlen(string));
    1.21  	write(tracefd, sockmsg_string(data->hdr.msg.type),
    1.22  	      strlen(sockmsg_string(data->hdr.msg.type)));