From: Ewan Mellor Subject: Re: Timing out waiting for vbd device *only when xend started with trace_start* Date: Mon, 14 Nov 2005 17:20:03 +0000 Message-ID: <20051114172003.GK16045@leeni.uk.xensource.com> References: <20051114115108.GA28247@leeni.uk.xensource.com> <43789319.9090609@spamcop.net> <20051114151038.GB16045@leeni.uk.xensource.com> <20051114163139.GH16045@leeni.uk.xensource.com> <4378BE1A.6060901@spamcop.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SO98HVl1bnMOfKZd" Return-path: Content-Disposition: inline In-Reply-To: <4378BE1A.6060901@spamcop.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Charles Duffy Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --SO98HVl1bnMOfKZd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 14, 2005 at 10:40:58AM -0600, Charles Duffy wrote: > Ewan Mellor wrote: > >On Mon, Nov 14, 2005 at 10:11:27AM -0600, Charles Duffy wrote: > > > >>It might be nice if the xend trace handler were expanded to print both > >>current PID (or thread name) and timestamp when indicating that a line > >>is being executed. > > > >Ask and ye shall receive an attachment. > > Nifty -- but not quite what I had in mind. > > I was thinking about modifying the *tracing*, not the *logging*; thus, > it would be the code in xend/server/SrvDaemon.py:trace that would be > impacted. You'll be after this one then! I don't think I'll check this in just yet, as it may significantly affect performance. If someone wanted to make this configurable in a way that didn't hurt tracing performance too much, that would be good. Ewan. --SO98HVl1bnMOfKZd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="trace-thread.patch" diff -r 6d981d34cf52 tools/python/xen/xend/server/SrvDaemon.py --- a/tools/python/xen/xend/server/SrvDaemon.py Mon Nov 14 11:28:47 2005 +++ b/tools/python/xen/xend/server/SrvDaemon.py Mon Nov 14 17:19:07 2005 @@ -8,7 +8,9 @@ import os import signal import sys +import thread import threading +import time import linecache import pwd import re @@ -201,6 +203,8 @@ pass def print_trace(self, string): + self.tracefile.write(time.strftime("%Y-%m-%d %H:%M:%S ")) + self.tracefile.write("%10x" % thread.get_ident()) for i in range(self.traceindent): ch = " " if (i % 5): --SO98HVl1bnMOfKZd Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --SO98HVl1bnMOfKZd--