[CRIU] Re: [PATCH] log: Don't show time stamp on pr_msg

Pavel Emelyanov xemul at parallels.com
Fri Nov 2 05:24:01 EDT 2012


On 11/02/2012 01:08 PM, Cyrill Gorcunov wrote:
> On Fri, Nov 02, 2012 at 12:58:24PM +0400, Pavel Emelyanov wrote:
>> On 11/02/2012 12:55 AM, Cyrill Gorcunov wrote:
>>> In case if the pr_err happens before pr_msg,
>>> the string buffer will have dangling timestamp
>>> prefix. Skip it here.
>>>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  log.c |    3 ++-
>>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/log.c b/log.c
>>> index 9629897..5fa1c6b 100644
>>> --- a/log.c
>>> +++ b/log.c
>>> @@ -182,11 +182,13 @@ void print_on_level(unsigned int loglevel, const char *format, ...)
>>>  
>>>  	if (unlikely(loglevel == LOG_MSG)) {
>>>  		fd = STDOUT_FILENO;
>>> +		off = buf_off;
>>
>> Not vice-versa? I.e. in case of printing on the screen we use offset
>> and in case of printing in file -- no?
> 
> The key moment is not the destination of where we are wprinting, but rather
> a log level. All pr_msg do skip timespamp. So no, not vise-versa.
> 
> Look at is as to the hint "if it's a LOG_MSG, skip timespamp if it's
> present".

I thought that "skip timestamp" means "print from the buffer start" which
in turn means "off = 0" which is not what I see in the patch.

> 	Cyrill
> .
> 




More information about the CRIU mailing list