All of lore.kernel.org
 help / color / mirror / Atom feed
From: piaojun <piaojun@huawei.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: virtio-fs@redhat.com
Subject: Re: [Virtio-fs] [PATCH 1/2] virtiofsd: print log only when priority is high enough
Date: Mon, 12 Aug 2019 10:28:28 +0800	[thread overview]
Message-ID: <5D50CECC.4000701@huawei.com> (raw)
In-Reply-To: <20190811153517.GF2665@desktop>



On 2019/8/11 23:35, Eryu Guan wrote:
> On Sun, Aug 11, 2019 at 10:32:16PM +0800, piaojun wrote:
>>
>>
>> On 2019/8/11 21:20, Eryu Guan wrote:
>>> On Fri, Aug 09, 2019 at 05:34:06PM +0800, piaojun wrote:
>>>> Hi Eryu,
>>>>
>>>> A very big patch, and I prefer spliting into several ones.
>>>
>>> Most of the changes are replacing
>>>
>>> 	if (lo->debug)
>>> 		fuse_debug(...);
>>>
>>> to
>>> 	fuse_debug(...);
>>>
>>> But yeah, it's fine to split, one patches introduce current_log_level
>>> related code, one does the replacements.
>>
>> Sounds reasonable.
>>
>>>
>>>>
>>>> On 2019/8/9 16:25, Eryu Guan wrote:
>>>>> Introduce "-o log_level=" command line option to specify current log
>>>>> level (priority), valid values are "debug info warn err", e.g.
>>>>>
>>>>>     ./virtiofsd -o log_level=debug ...
>>>>>
>>>>> So only log priority higher than "debug" will be printed to
>>>>> stderr/syslog. And the default level is info.
>>>>>
>>>>> The "-o debug"/"-d" options are kept, and imply debug log level.
>>>>
>>>> I wonder if this will make user confused when there are two options for
>>>> debug.
>>>
>>> Forgot to mention, one reason to keep "-o debug/-d" options is try not
>>> to break existing users, e.g. kata-runtime. But I have no strong
>>> preference on this.
>>
>> Yes, compat is always important, and I have little knowledge about kata,
>> so it would be best to reach an agreement with it.
>>
>> After looking though all the fuse_log codes, I come up with a new idea
>> to do this.
>> 1. Expand the debug in struct lo_data to *log_level* which represent
>> err, warn, info and debug;
>>
>> struct lo_data {
>> 	pthread_mutex_t mutex;
>> 	int debug -> *log_level*;
> 
> I thought about this too, but that means that fuse_debug/info/warn/err
> functions should take lo_data or fuse_session as argument as well, and I
> don't think it's worth to introduce such complexity, a global log level
> would be easier. And I think it's possible & easier to add support to
> change the log level (as a global variable) when virtiofsd is running,
> e.g. on SIGHUP.

Perhaps you did not get my point, and we may just use lo_data to set
*current_log_level* once, no need always pass it.

We'd better do little harm do the origin code struct if possible.

Jun


  reply	other threads:[~2019-08-12  2:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09  8:25 [Virtio-fs] [PATCH 1/2] virtiofsd: print log only when priority is high enough Eryu Guan
2019-08-09  8:25 ` [Virtio-fs] [PATCH 2/2] virtiofsd: convert more fprintf and perror to use fuse log infra Eryu Guan
2019-08-09  9:40   ` piaojun
2019-08-11 13:21     ` Eryu Guan
2019-08-11 14:12       ` piaojun
2019-08-16 16:52   ` Dr. David Alan Gilbert
2019-08-09  9:34 ` [Virtio-fs] [PATCH 1/2] virtiofsd: print log only when priority is high enough piaojun
2019-08-11 13:20   ` Eryu Guan
2019-08-11 14:32     ` piaojun
2019-08-11 15:35       ` Eryu Guan
2019-08-12  2:28         ` piaojun [this message]
2019-08-15  9:45         ` Dr. David Alan Gilbert

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=5D50CECC.4000701@huawei.com \
    --to=piaojun@huawei.com \
    --cc=guaneryu@gmail.com \
    --cc=virtio-fs@redhat.com \
    /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.