[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/ukdebug: print DLVL_EXTRA messages only in debug build



Hi,

It is per-system already in this patch.

Let me copy the commit message here:

  With this patch, messages of DLVL_EXTRA will be printed ONLY if
  UK_DEBUG is defined. Now a developer can chose for which parts of
  Unikraft he wants an extra verbosity of the output, by adding a single
  line into the Makefile.uk.
  
  For example:
      /* Enable for one lib */
      LIBNAME_CFLAGS-y             += -DUK_DEBUG
  
      /* Enable globally in Unikraft (brace yourself) */
      CFLAGS-y                     += -DUK_DEBUG
  

You define UK_DEBUG for specific files or subsystems. For now there is
no option in menuconfig, you gonna need to add a line into Makefile.uk.
Then all files belonging to LIBNAME will be build with UK_DEBUG
defined. Meaning debug output for this library will be compiled in. For
all other subsystems, which did not get -DUK_DEBU all pr_debug's
(currently it is uk_printd(DLVL_EXTRA, ..)) will produce zero code.


Oh, and by the way, Linux does the same.


-Yuri.

Florian Schmidt <florian@xxxxxxxxx> writes:

> Hi,
>
> so after reading your's and Simon's answer, I'm still not quite clear 
> about one thing. Is this planned to be per-subsystem or not? It sounded 
> to me like it's not, and it's governed by a global define UK_DEBUG for 
> all subsystems.
>
> Or is it really strictly just for temporary debugging, i.e., a patch 
> applied to staging/master should never have any uk_printd() calls in it?
>
> Cheers,
> Florian
>
> On 08/01/2018 12:03 PM, Yuri Volchkov wrote:
>> Hi,
>> 
>>> I kinda like approaches like the linux kernel has, which allows you to
>>> set debug output per subsystem level (which I guess in our case would
>>> be libraries)
>> In fact the proposal was to do it similar to linux kernel scheme. Here
>> is a sentence from
>> https://www.kernel.org/doc/html/v4.10/process/coding-style.html
>> 
>>   "While the other pr_XXX() functions print unconditionally, pr_debug()
>>    does not; it is compiled out by default, unless either DEBUG is
>>    defined or CONFIG_DYNAMIC_DEBUG is set."
>> 
>> Matching it to what Simon wrote:
>> 1) uk_printk is equivalent to linux's printk with levels up to KERN_INFO
>> 
>> 2) uk_printd is equivalent to linux's pr_debug(). However, in linux just
>>     defining "DEBUG" for a file or subsystem is not enough, you also need
>>     to change the printk level to KERN_DEBUG (e.g. echo 7 >
>>     /proc/sys/kernel/printk). The same happens in current patch I have
>>     sent, but the idea is to make debug output independent from the
>>     current selected level in the future.
>> 
>> 
>>> because global log levels of high verbosity can end up drowning you in
>>> messages.
>> Right, non-debug output should be readable even at maximum verbosity
>> level. If a print spits to many messages it either should be pr_debug
>> (or whatever we name it), or, it should be rate limited.
>> 
>>> However, I'm aware that's a bit of a larger redesign, so I'm not sure we
>>> want to go for it at the moment.
>> This is dynamic print. We will get there eventually. This patch is a
>> first baby step towards it.
>> 
>> -Yuri.
>> 
>> Florian Schmidt <florian@xxxxxxxxx> writes:
>> 
>>> Hi everyone,
>>>
>>> On 07/31/2018 03:05 PM, Simon Kuenzer wrote:
>>>> Give me a +1/0/-1.
>>>
>>> I'm a 0 on this one.
>>>
>>> I agree that it's (slightly) less confusing than the current situation.
>>> Then again, I kinda like approaches like the linux kernel has, which
>>> allows you to set debug output per subsystem level (which I guess in our
>>> case would be libraries) because global log levels of high verbosity can
>>> end up drowning you in messages.
>>>
>>> However, I'm aware that's a bit of a larger redesign, so I'm not sure we
>>> want to go for it at the moment.
>>>
>>> Cheers, Florian
>>>
>>> _______________________________________________
>>> Minios-devel mailing list
>>> Minios-devel@xxxxxxxxxxxxxxxxxxxx
>>> https://lists.xenproject.org/mailman/listinfo/minios-devel
>> 

-- 
Yuri Volchkov
Software Specialist

NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.