All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [PATCH v5 1/4] xen: fix debugtrace clearing
Date: Thu, 5 Sep 2019 14:22:29 +0200	[thread overview]
Message-ID: <8a3b704f-e16c-de09-9b09-97014a6168a8@suse.com> (raw)
In-Reply-To: <45cd123c-f6b5-a687-469c-9cec9164adc4@suse.com>

On 05.09.19 14:17, Jan Beulich wrote:
> On 05.09.2019 13:39, Juergen Gross wrote:
>> After dumping the debugtrace buffer it is cleared. This results in some
>> entries not being printed in case the buffer is dumped again before
>> having wrapped.
>>
>> While at it remove the trailing zero byte in the buffer as it is no
>> longer needed. Commit b5e6e1ee8da59f introduced passing the number of
>> chars to be printed in the related interfaces, so the trailing 0 byte
>> is no longer required.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
> 
> Technically this is fine, so it can have my
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> However, ...
> 
>> @@ -1173,6 +1175,7 @@ static char        *debugtrace_buf; /* Debug-trace buffer */
>>   static unsigned int debugtrace_prd; /* Producer index     */
>>   static unsigned int debugtrace_kilobytes = 128, debugtrace_bytes;
>>   static unsigned int debugtrace_used;
>> +static char debugtrace_last_entry_buf[DEBUG_TRACE_ENTRY_SIZE];
> 
> ... this is what I was afraid would happen, but I admit I didn't
> reply in a way previously indicating that I dislike such a
> solution. This is also why, when noticing the issue, I didn't put
> together a patch myself right away. In particular I'm of the
> opinion that the three last_* values would better all stay
> together, and then would better stay inside the only function
> using them.
> 
>> @@ -1279,11 +1280,11 @@ void debugtrace_printk(const char *fmt, ...)
>>       }
>>       else
>>       {
>> -        if ( strcmp(buf, last_buf) )
>> +        if ( strcmp(buf, debugtrace_last_entry_buf) )
> 
> Wouldn't moving count to file scope and latching its value into
> a new dump_count when dumping work:
> 
>          if ( count == dump_count || strcmp(buf, last_buf) )
> 
> work?

I'd rather have a bool which will be reset in above condition. This will
avoid problems when count is wrapping.


Juergen

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

  reply	other threads:[~2019-09-05 12:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 11:39 [Xen-devel] [PATCH v5 0/4] xen: debugtrace cleanup and per-cpu buffer support Juergen Gross
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 1/4] xen: fix debugtrace clearing Juergen Gross
2019-09-05 12:17   ` Jan Beulich
2019-09-05 12:22     ` Juergen Gross [this message]
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 2/4] xen: move debugtrace coding to common/debugtrace.c Juergen Gross
2019-09-05 12:20   ` Jan Beulich
2019-09-05 12:32     ` Juergen Gross
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 3/4] xen: refactor debugtrace data Juergen Gross
2019-09-05 12:01   ` Jan Beulich
2019-09-05 12:12     ` Juergen Gross
2019-09-05 12:22       ` Jan Beulich
2019-09-05 12:27         ` Juergen Gross
2019-09-05 12:37           ` Jan Beulich
2019-09-05 12:46             ` Juergen Gross
2019-09-05 14:36               ` Juergen Gross
2019-09-05 14:43                 ` Jan Beulich
2019-09-06  8:49                   ` Juergen Gross
2019-09-06  9:10                     ` Jan Beulich
2019-09-06  9:21                       ` Juergen Gross
2019-09-05 12:13   ` Jan Beulich
2019-09-05 12:19     ` Juergen Gross
2019-09-05 12:24       ` Jan Beulich
2019-09-05 11:39 ` [Xen-devel] [PATCH v5 4/4] xen: add per-cpu buffer option to debugtrace Juergen Gross
2019-09-05 11:58   ` Jan Beulich

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=8a3b704f-e16c-de09-9b09-97014a6168a8@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --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 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.