All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Cedric Bosdonnat <cbosdonnat@suse.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen-devel@lists.xen.org
Subject: Re: per-domain logging
Date: Fri, 7 Oct 2016 15:09:16 +0100	[thread overview]
Message-ID: <20161007140916.GK3687@citrix.com> (raw)
In-Reply-To: <1475572492.3315.3.camel@suse.com>

On Tue, Oct 04, 2016 at 11:14:52AM +0200, Cedric Bosdonnat wrote:
> Hi Ian and Wei,
> 
> On Mon, 2016-09-19 at 16:23 +0100, Ian Jackson wrote:
> > Cedric Bosdonnat writes ("Re: [Xen-devel] per-domain logging"):
> > > On Thu, 2016-09-15 at 16:11 +0100, Wei Liu wrote:
> > > > IIRC there is already logfile abstraction inside libvirt -- can you just
> > > > pass in a libvirt logfile fd and try to demux there?
> > > 
> > > 
> > > The abstraction we have is something similar to the XenToolLogger,
> > > not something abstracting the log files. Even if we had that, how
> > > could we demux since there is no domain name in the libxl messages.
> 
> I came up with a commit on the libvirt side writing a custom xtl_logger
> that demuxes the log messages. Here it is for the curious ones:
> 
> https://github.com/cbosdo/libvirt/commit/5e28dd67c52a49b11635167469a8b60dcb4e287c
> 
> This way, libvirt would put all log messages containing ': Domain %u:' in a
> separate log file and all non-matching messages would go to the default
> libxl-driver.log file.
> 
> > Right.
> > 
> > It's not trivial to change the xtl API because there is no
> > negotiation, just a vops structure.  I can think of a way to do it,
> > but do we want to make all xtl logger users (that is, all generators
> > of log messages) pass a domid ?
> > 
> > Do we want to extend this to other information ?  (Not sure _what_
> > other information.)
> > 
> > Alternatively, we could have libxl (and perhaps libxc) put the domid
> > in a standard format in the message, so it could be extracted ?
> > 
> > However we do it, we would have to add a domid to every LOG call in
> > libxl.
> 
> Attached is a partial attempt at this that I wrote to test my libvirt code.
> How does that sound to you? Should I continue like this? Obviously I surely
> missed a few log messages that could get a domid, but it seems that even libxl
> has log messages that can't have a domid.
> 

Instead of trying to change all the format strings I think it would be
better to have a new set of LOG macros that takes domid.

Something like:
  LOGEVD(ERROR, errno, domid, "xxxx");

I would also like to have the log format written down in some document
or header file.

But let's step back a bit: have we agreed on the approach forward? This
thread doesn't seem to have a clear conclusion yet.  Obviously I don't
want you to waste your writing code that's going to be threw away.

If you're happy with demuxing in libvirt, I won't object to it. Looks
like there is relatively less code churn involved than other solutions,
say, libxl keeping track of a set of per-domain xtl loggers.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-10-07 14:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 14:22 per-domain logging Cedric Bosdonnat
2016-09-15 14:50 ` Wei Liu
2016-09-15 15:11   ` Wei Liu
2016-09-15 15:41     ` Cedric Bosdonnat
2016-09-19 15:23       ` Ian Jackson
2016-09-19 16:53         ` Konrad Rzeszutek Wilk
2016-10-04  9:14         ` Cedric Bosdonnat
2016-10-07 14:09           ` Wei Liu [this message]
2016-10-07 15:37             ` Ian Jackson
2016-10-10  7:05               ` Cedric Bosdonnat
2016-10-10  7:03             ` Cedric Bosdonnat
2016-10-10 10:06               ` Wei Liu
2016-10-13  9:28                 ` Cedric Bosdonnat
2016-10-13  9:41                   ` Wei Liu
2016-11-09 10:27                     ` Cedric Bosdonnat
2016-11-11  1:51                       ` Wei Liu
2016-11-11 11:22                       ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161007140916.GK3687@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=cbosdonnat@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.