All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Julien Grall <julien.grall@arm.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/2] xen/debug: make debugtrace more clever regarding repeating entries
Date: Thu, 14 Mar 2019 15:28:10 +0100	[thread overview]
Message-ID: <ba20dba4-51b8-584d-1cc1-c5e766aae955@suse.com> (raw)

On 14/03/2019 15:14, Jan Beulich wrote:
>>>> On 14.03.19 at 14:40, <andrew.cooper3@citrix.com> wrote:
>> On 14/03/2019 13:38, Juergen Gross wrote:
>>> On 14/03/2019 14:33, Jan Beulich wrote:
>>>>>>> On 14.03.19 at 10:37, <jgross@suse.com> wrote:
>>>>> --- a/xen/drivers/char/console.c
>>>>> +++ b/xen/drivers/char/console.c
>>>>> @@ -1225,13 +1225,28 @@ void debugtrace_dump(void)
>>>>>      watchdog_enable();
>>>>>  }
>>>>>  
>>>>> +static void debugtrace_add_to_buf(char *buf)
>>>>> +{
>>>>> +    char *p;
>>>>> +
>>>>> +    for ( p = buf; *p != '\0'; p++ )
>>>>> +    {
>>>>> +        debugtrace_buf[debugtrace_prd++] = *p;
>>>>> +        /* Always leave a nul byte at the end of the buffer. */
>>>>> +        if ( debugtrace_prd == (debugtrace_bytes - 1) )
>>>>> +            debugtrace_prd = 0;
>>>>> +    }
>>>>> +}
>>>>> +
>>>>>  void debugtrace_printk(const char *fmt, ...)
>>>>>  {
>>>>> -    static char    buf[1024];
>>>>> -    static u32 count;
>>>>> +    static char buf[1024];
>>>>> +    static char last_buf[1024];
>>>>> +    static u32 count, last_count;
>>>> Please change to uint32_t or even better simply to unsigned int.
>>> Okay.
>>>
>>>>> @@ -1243,25 +1258,32 @@ void debugtrace_printk(const char *fmt, ...)
>>>>>  
>>>>>      ASSERT(debugtrace_buf[debugtrace_bytes - 1] == 0);
>>>>>  
>>>>> -    snprintf(buf, sizeof(buf), "%u ", ++count);
>>>>> -
>>>>>      va_start(args, fmt);
>>>>> -    (void)vsnprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), fmt, args);
>>>>> +    (void)vsnprintf(buf, sizeof(buf), fmt, args);
>>>> Please take the opportunity and drop the stray cast.
>>> Will do.
>>
>> Both can be done on commit, surely?
> 
> Perhaps, albeit iirc the first would amount to more than just s/u32/.../
> on the line in question.

What else would you want to do?


Juergen

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

         reply	other threads:[~2019-03-14 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14  9:37 [PATCH 0/2] xen: some debug trace enhancements Juergen Gross
2019-03-14  9:37 ` [PATCH 1/2] xen/debug: make debugtrace configurable via Kconfig Juergen Gross
2019-03-14 13:26   ` Jan Beulich
2019-03-14  9:37 ` [PATCH 2/2] xen/debug: make debugtrace more clever regarding repeating entries Juergen Gross
2019-03-14 13:33   ` Jan Beulich
     [not found]   ` <5C8A5842020000780021EA3E@suse.com>
2019-03-14 13:38     ` Juergen Gross
2019-03-14 13:40       ` Andrew Cooper
2019-03-14 14:14         ` Jan Beulich
     [not found]         ` <5C8A61CB020000780021EB19@suse.com>
2019-03-14 14:28           ` Juergen Gross [this message]
2019-03-14 14:31             ` Jan Beulich
  -- strict thread matches above, loose matches on Subject: below --
2019-03-14 14:36 Juergen Gross
     [not found] <20190314093733.18175*1*jgross@suse.com>

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=ba20dba4-51b8-584d-1cc1-c5e766aae955@suse.com \
    --to=jgross@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --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 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.