All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wieczorkiewicz, Pawel" <wipawel@amazon.de>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Wieczorkiewicz, Pawel" <wipawel@amazon.de>
Subject: Re: [PATCH XTF] vsnprintf: Expand \n to \r\n for console output
Date: Fri, 5 Jun 2020 06:59:59 +0000	[thread overview]
Message-ID: <CD71BEEB-2440-4170-977F-7186CE7B21AD@amazon.com> (raw)
In-Reply-To: <20200604141223.14153-1-andrew.cooper3@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 1916 bytes --]


> On 4. Jun 2020, at 16:12, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> 
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
> 
> 
> 
> xenconsoled doesn't automatically convert \n into \r\n, which causes test
> output appear like this in a terminal:
> 
>  [root@host ~]# xl create -c tests/selftest/test-pv64-selftest.cfg
>  Parsing config from tests/selftest/test-pv64-selftest.cfg
>  --- Xen Test Framework ---
>                            Environment: PV 64bit (Long mode 4 levels)
>                                                                      XTF Selftests
> 
> There are a number of ways to do this, but by far the most efficient way is to
> have vsnprintf() expand \n's in the output buffer.
> 
> This however is non-standard behaviour for vsnprintf().  Rename it to
> vsnprintf_internal() and take extra flags, and have vprintk() use the new
> LF_TO_CRLF control flag.
> 
> Inside vsnprintf_internal(), rearrange the non-format and %c logic to share
> the expansion logic, as well as extending the logic to fmt_string().
> 
> Extend the selftests to confirm correct behaviour in both modes, for all ways
> of being able to pass newline characters into a format operation.
> 
> Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> Pawel: Does this fix the issues you were seeing?

Yes, it does fix the issue. Thanks.

> ---
> common/console.c        |  2 +-
> common/libc/vsnprintf.c | 23 +++++++++++++++--------
> include/xtf/libc.h      | 15 ++++++++++++++-
> tests/selftest/main.c   | 38 ++++++++++++++++++++++++++++++++++++++
> 4 files changed, 68 insertions(+), 10 deletions(-)
> 
> 

<snip>

Best Regards,
Pawel Wieczorkiewicz
wipawel@amazon.com



[-- Attachment #1.2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2.1: Type: text/plain, Size: 237 bytes --]




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879



[-- Attachment #2.2: Type: text/html, Size: 277 bytes --]

      reply	other threads:[~2020-06-05  7:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 14:12 [PATCH XTF] vsnprintf: Expand \n to \r\n for console output Andrew Cooper
2020-06-05  6:59 ` Wieczorkiewicz, Pawel [this message]

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=CD71BEEB-2440-4170-977F-7186CE7B21AD@amazon.com \
    --to=wipawel@amazon.de \
    --cc=andrew.cooper3@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.