[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 01/35] libxl: add LIBXL_LOGD_* and LOG*D function families.
On Thu, Nov 17, 2016 at 05:01:08PM +0100, Cedric Bosdonnat wrote: > On Thu, 2016-11-17 at 14:41 +0000, Wei Liu wrote: > > On Tue, Nov 15, 2016 at 11:18:39AM +0100, Cédric Bosdonnat wrote: > > > From: Cédric Bosdonnat <cedric.bosdonnat@xxxxxxx> > > > > > > These functions should be used to log messages when the domain > > > id is known. libxl__log will now prepend the log message by > > > "Domain %PRIu32:" if the domain id is a valid one. > > > > > > This aims at helping consumers filter logs on domain IDs. > > > > > > Signed-off-by: Cédric Bosdonnat <cbosdonnat@xxxxxxxx> > > > --- > > > tools/libxl/libxl_event.c | 6 +++--- > > > tools/libxl/libxl_internal.c | 16 ++++++++++------ > > > tools/libxl/libxl_internal.h | 38 +++++++++++++++++++++++++++++++------- > > > 3 files changed, 44 insertions(+), 16 deletions(-) > > > > > > diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c > > > index 02b39e6..fc9bdc9 100644 > > > --- a/tools/libxl/libxl_event.c > > > +++ b/tools/libxl/libxl_event.c > > > @@ -1362,7 +1362,7 @@ void libxl__event_disaster(libxl__egc *egc, const > > > char *msg, int errnoval, > > > { > > > EGC_GC; > > > > > > - libxl__log(CTX, XTL_CRITICAL, errnoval, file, line, func, > > > + libxl__log(CTX, XTL_CRITICAL, errnoval, file, line, func, > > > INVALID_DOMID, > > > "DISASTER in event loop: %s%s%s%s", > > > msg, > > > type ? " (relates to event type " : "", > > > @@ -1943,7 +1943,7 @@ libxl__ao *libxl__ao_create(libxl_ctx *ctx, > > > uint32_t domid, > > > ao->poller = libxl__poller_get(&ao->gc); > > > if (!ao->poller) goto out; > > > } > > > - libxl__log(ctx,XTL_DEBUG,-1,file,line,func, > > > + libxl__log(ctx,XTL_DEBUG,-1,file,line,func,domid, > > > "ao %p: create: how=%p callback=%p poller=%p", > > > ao, how, ao->how.callback, ao->poller); > > > > > > @@ -1968,7 +1968,7 @@ int libxl__ao_inprogress(libxl__ao *ao, > > > assert(ao->in_initiator); > > > ao->constructing = 0; > > > > > > - libxl__log(CTX,XTL_DEBUG,-1,file,line,func, > > > + libxl__log(CTX,XTL_DEBUG,-1,file,line,func,INVALID_DOMID, > > > > You should be able to use ao->domid here, right? > > Oh indeed. I discovered this one after writing this patch and forgot > about it here. Could it be possible that ao->domid is not the publicly > known domain id? I think it is the publicly known domain id -- it was initialised in libxl__ao_create which got domid from caller. Wei. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |