All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Juergen Gross <jgross@suse.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>,
	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 <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 2/2] xen/debug: make debugtrace more clever regarding repeating entries
Date: Thu, 14 Mar 2019 08:31:37 -0600	[thread overview]
Message-ID: <5C8A65C9020000780021EBA3@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <ba20dba4-51b8-584d-1cc1-c5e766aae955@suse.com>

>>> On 14.03.19 at 15:28, <jgross@suse.com> wrote:
> 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?

Fold it with the adjacent unsigned int declaration (iirc there was one).

Jan



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

  reply	other threads:[~2019-03-14 14:31 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
2019-03-14 14:31             ` Jan Beulich [this message]
  -- 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=5C8A65C9020000780021EBA3@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jgross@suse.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.