From: Anthony PERARD <anthony.perard@vates.tech>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Orzel <michal.orzel@amd.com>,
xen-devel@lists.xenproject.org,
Doug Goldstein <cardoe@cardoe.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] automation: restore CR filtering
Date: Tue, 20 Aug 2024 12:30:15 +0000 [thread overview]
Message-ID: <ZsSMVaoJlR4mn7Ig@l14> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2408191819580.298534@ubuntu-linux-20-04-desktop>
On Mon, Aug 19, 2024 at 06:56:47PM -0700, Stefano Stabellini wrote:
> On Mon, 19 Aug 2024, Anthony PERARD wrote:
> > On Mon, Aug 19, 2024 at 09:21:22AM +0200, Michal Orzel wrote:
> > > On 17/08/2024 01:46, Stefano Stabellini wrote:
> > > > diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > index 0666f6363e..ed44aab0f0 100755
> > > > --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
> > > > export QEMU_LOG="smoke.serial"
> > > > export PASSED="${passed}"
> > > >
> > > > -./automation/scripts/qemu-key.exp
> > > > +./automation/scripts/qemu-key.exp | sed 's/\r//'
> > >
> > > I compared 3 pipelines:
> > > 1) one before c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7566986885)
> > > 2) one after c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7603830706)
> > > 3) one with this fix (https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7603783403)
> > >
> > > In 1), there is Xen log + Linux log in Gitlab web page
> > > In 2), there is no log at all
> > > In 3), there is only Xen log visible
> >
> > It's nice that you can select uboot/Xen logs or Linux logs based on the
> > number of '\r' at the end of a line (output cat -A):
> > U-Boot 2023.01+dfsg-2+deb12u1 (Apr 18 2024 - 22:00:21 +0000)^M^M$
> > (XEN) [ 0.013864] Xen version 4.20-unstable (root@) (gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924) debug=n Sat Aug 17 00:54:57 UTC 2024^M^M$
> > [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]^M^M^M$
> >
> > But to display to GitLab's job logs, we want: sed 's/\r\+$//'
> >
> > Also, do you have to edit every single script to overcome a shortcoming
> > from the "expect" script? Can't you write a bit of Tcl and edit the line
> > in the script instead?
>
> The sed route is not perfect but it works :-)
>
> I did try using expect but the logs were mangled. I think I missed that
> there can be multilple \r. I managed to get close to the wanted behavior
> with the below, but the Xen logs are still missing and I don't know why.
>
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552
Well, it just looks like the output is duplicated, if you look at the
raw output:
https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552/raw
So I don't know if it's possible to edit the output before `expect`
prints it. It probably is, but not easy to do.
I did try to edit the command line to change QEMU's output:
-eval spawn $env(QEMU_CMD)
+spawn sh -c "$env(QEMU_CMD) | sed s/\\\\r\\\\+//"
But then many failure, probably because expect can't interact with qemu
anymore.
So I guess `sed` the output of `expect` will do. Maybe put that in a
script that also call the expect script? (To avoid duplication, and help
with maintainability of the whole thing.)
Cheers,
--
Anthony Perard | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
next prev parent reply other threads:[~2024-08-20 12:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-16 23:46 [PATCH] automation: restore CR filtering Stefano Stabellini
2024-08-19 7:21 ` Michal Orzel
2024-08-19 15:34 ` Anthony PERARD
2024-08-20 1:56 ` Stefano Stabellini
2024-08-20 12:30 ` Anthony PERARD [this message]
2024-08-21 3:48 ` Stefano Stabellini
2024-08-21 12:06 ` Anthony PERARD
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=ZsSMVaoJlR4mn7Ig@l14 \
--to=anthony.perard@vates.tech \
--cc=andrew.cooper3@citrix.com \
--cc=cardoe@cardoe.com \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.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.