From: "Jan Beulich" <JBeulich@suse.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH v2 3/3] xl: new "loglvl" command
Date: Mon, 14 Mar 2016 11:00:36 -0600 [thread overview]
Message-ID: <56E6FC4402000078000DC27E@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20160314160124.GB22805@citrix.com>
>>> On 14.03.16 at 17:01, <wei.liu2@citrix.com> wrote:
> On Mon, Mar 14, 2016 at 09:49:11AM -0600, Jan Beulich wrote:
>> >>> On 14.03.16 at 16:36, <wei.liu2@citrix.com> wrote:
>> > On Mon, Mar 14, 2016 at 09:23:35AM -0600, Jan Beulich wrote:
>> >> >>> On 08.03.16 at 17:20, <wei.liu2@citrix.com> wrote:
>> >> > On Fri, Mar 04, 2016 at 09:48:16AM -0700, Jan Beulich wrote:
>> >> >> --- a/tools/libxl/xl_cmdimpl.c
>> >> >> +++ b/tools/libxl/xl_cmdimpl.c
>> >> >> @@ -6469,6 +6469,84 @@ int main_debug_keys(int argc, char **arg
>> >> >> return 0;
>> >> >> }
>> >> >>
>> >> >> +static const struct {
>> >> >> + int level;
>> >> >> + char string[8];
>> >> >> +} loglvls[] = {
>> >> >> + { 0, "none" },
>> >> >> + { 1, "error" },
>> >> >> + { 2, "warning" },
>> >> >> + { 3, "info" },
>> >> >> + { 4, "all" },
>> >> >> + { 4, "debug" },
>> >> >
>> >> > The semantics of the numbers should go into libxl_types.idl. Maybe
>> >> > something like
>> >> >
>> >> > # Keep in sync with Xen log level.
>> >> > libxl_xen_log_level = Enumeration (...);
>> >> >
>> >> > Then in here
>> >> >
>> >> > static const struct {
>> >> > int level;
>> >> > char string[8];
>> >> > } loglvls[] = {
>> >> > { LIBXL_XEN_LOG_LEVEL_NONE, "none" },
>> >> > { ..., "error" },
>> >> > { ..., "warning" },
>> >> > { ..., "info" },
>> >> > { ..., "all" },
>> >> > { ..., "debug" },
>> >> >
>> >> > Please also note that after the introduction of this API, Xen log level
>> >> > will become part of the stable API and subject to some compatibility
>> >> > constraints. Is this what you wanted?
>> >>
>> >> No, and I actually I'm having trouble following your request: This
>> >> lives in xl_cmdimpl.c, which I didn't think is subject to any stability
>> >> requirements in the mapping of strings (from the xl command line)
>> >> to numbers. It is _specifically_ that I do not want to fix those
>> >> mappings.
>> >
>> > The new API libxl_log_level relies on the semantics of these mappings.
>> > To make the new API useful to all clients, the semantics of log levels
>> > needs to go into libxl_types.idl (as mentioned a few lines above), hence
>> > it becomes part of the stable API. Otherwise you end up with an API
>> > accepting arbitrary magic numbers.
>>
>> Well - what do you suggest? I'm meanwhile willing to give up on this,
>> as baking the mapping into some ABI is clearly not what we should do
>> or what I want. Moving the translation into libxl also wouldn't help.
>> Which would leave the option of doing this in libxc, but then again I'm
>> generally opposed to passing around strings instead of numbers, as
>> the latter are better to work with at all layers.
>>
>
> I don't have a very clear idea on what to suggest at the moment, sorry.
> What kind of changes to xen log level might happen in the future?
They could become more fine grained (for example, Linux has a
few more than we have now). And the string/number correlation
is an implementation detail anyway.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-03-14 17:00 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 16:38 [PATCH v2 0/3] allow runtime log level threshold adjustments Jan Beulich
2016-03-04 16:46 ` [PATCH v2 1/3] console: allow " Jan Beulich
2016-03-04 20:55 ` Konrad Rzeszutek Wilk
2016-03-07 10:44 ` Jan Beulich
2016-03-07 14:41 ` Konrad Rzeszutek Wilk
2016-03-07 15:19 ` Jan Beulich
2016-03-04 16:47 ` [PATCH v2 2/3] libxc: wrapper for log level sysctl Jan Beulich
2016-03-05 16:00 ` Dario Faggioli
2016-03-08 16:20 ` Wei Liu
2016-03-04 16:48 ` [PATCH v2 3/3] xl: new "loglvl" command Jan Beulich
2016-03-04 18:45 ` Dario Faggioli
2016-03-07 11:46 ` Jan Beulich
2016-03-07 18:07 ` Dario Faggioli
2016-03-08 8:08 ` Jan Beulich
2016-03-08 14:05 ` George Dunlap
2016-03-08 16:09 ` Wei Liu
2016-03-08 18:05 ` Dario Faggioli
2016-03-05 15:36 ` Dario Faggioli
2016-03-07 13:20 ` Fabio Fantoni
2016-03-07 13:26 ` Jan Beulich
2016-03-08 16:20 ` Wei Liu
2016-03-14 15:23 ` Jan Beulich
2016-03-14 15:36 ` Wei Liu
2016-03-14 15:49 ` Jan Beulich
2016-03-14 16:01 ` Wei Liu
2016-03-14 17:00 ` Jan Beulich [this message]
2016-03-14 17:07 ` Ian Jackson
2016-03-15 7:37 ` Jan Beulich
2016-03-15 13:58 ` Wei Liu
2016-03-15 14:07 ` Jan Beulich
2016-03-15 14:51 ` Wei Liu
2016-03-15 15:03 ` Jan Beulich
2016-03-15 15:38 ` Ian Jackson
2016-03-16 11:22 ` Jan Beulich
2016-04-28 15:33 ` Wei Liu
2016-04-29 7:20 ` Jan Beulich
2016-05-02 11:14 ` Wei Liu
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=56E6FC4402000078000DC27E@prv-mh.provo.novell.com \
--to=jbeulich@suse.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).