From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Anthony PERARD <anthony@xenproject.org>,
Stefano Stabellini <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org,
Anthony PERARD <anthony.perard@vates.tech>,
Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [XEN PATCH 9/9] CI: Add timing to junit
Date: Wed, 4 Jun 2025 13:33:03 +0200 [thread overview]
Message-ID: <aEAu753_eexjZn08@mail-itl> (raw)
In-Reply-To: <384fd17a-9236-4727-b564-543edff65e9e@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 2821 bytes --]
On Wed, Jun 04, 2025 at 11:57:11AM +0100, Andrew Cooper wrote:
> On 04/06/2025 9:48 am, Anthony PERARD wrote:
> > On Tue, Jun 03, 2025 at 11:35:22AM -0700, Stefano Stabellini wrote:
> >> On Tue, 3 Jun 2025, Anthony PERARD wrote:
> >>> From: Anthony PERARD <anthony.perard@vates.tech>
> >>>
> >>> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
> >>> ---
> >>> automation/scripts/run-tools-tests | 5 ++++-
> >>> 1 file changed, 4 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/automation/scripts/run-tools-tests b/automation/scripts/run-tools-tests
> >>> index 852c1cfbcf..e38cc4068c 100755
> >>> --- a/automation/scripts/run-tools-tests
> >>> +++ b/automation/scripts/run-tools-tests
> >>> @@ -18,9 +18,12 @@ for f in "$1"/*; do
> >>> continue
> >>> fi
> >>> echo "Running $f"
> >>> - printf ' <testcase name="%s">\n' "$f" >> "$xml_out"
> >>> + time_start=$EPOCHREALTIME
> >>> "$f" 2>&1 | tee /tmp/out
> >>> ret=${PIPESTATUS[0]}
> >>> + time_end=$EPOCHREALTIME
> >>> + time_test="$(bc <<<"$time_end - $time_start")"
> >> As it looks like no other scripts need bc at the moment but we already
> >> rely on awk (automation/scripts/xilinx-smoke-dom0less-arm64.sh) I'd
> >> prefer this version:
> >>
> >> time_test="$(awk "BEGIN {print $time_end - $time_start}")"
> > You mean I have to choose between busybox and busybox?
> >
> > $ ls -l $(which bc awk)
> > lrwxrwxrwx 1 root root 12 Feb 13 23:19 /usr/bin/awk -> /bin/busybox
> > lrwxrwxrwx 1 root root 12 Feb 13 23:19 /usr/bin/bc -> /bin/busybox
> >
> > :-)
> >
> > I guess it doesn't really matter.
> >
> > One difference though:
> > $ awk "BEGIN {print $time_end - $time_start}"
> > 3.28798
> > $ bc <<<"$time_end - $time_start"
> > 3.287982
> >
> > awk is less precise, but I guess that doesn't matter as well, gitlab UI
> > isn't going to show the extra digits.
> >
> > So I guess I can change to use `awk` instead, just in case for some
> > reason `bc` isn't present, since `awk` seems mandatory for many of our
> > scripts.
> >
> > Thanks,
>
> bc is a normal posix utility just like awk is, so there's no change in
> dependencies caused by this.
Linux requires bc for building, and I _very_ often find systems where it
isn't installed by default (by awk is)...
Anyway, that's probably irrelevant in the CI container that has busybox
for both.
> Furthermore, it is the right tool for this job in a way that awk isn't.
> Besides the reduction in precision, see xen/tools/check-endbr.sh for the
> number of ways we found that awk malfunctions with large numbers.
>
> I firmly suggest continuing to use bc here.
>
> ~Andrew
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2025-06-04 11:33 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 12:42 [XEN PATCH 0/9] CI: Fixes for tools/tests and junit and other Anthony PERARD
2025-06-03 12:42 ` [XEN PATCH 1/9] CI: Add SELECTED_JOBS_ONLY to analyze.yaml Anthony PERARD
2025-06-03 13:09 ` Andrew Cooper
2025-06-03 18:21 ` Stefano Stabellini
2025-06-03 12:42 ` [XEN PATCH 2/9] tools/tests: Fix return value of test-rangeset Anthony PERARD
2025-06-03 13:07 ` Andrew Cooper
2025-06-03 12:42 ` [XEN PATCH 3/9] CI: Fix status check for tools/tests Anthony PERARD
2025-06-03 13:07 ` Andrew Cooper
2025-06-03 18:22 ` Stefano Stabellini
2025-06-03 12:42 ` [XEN PATCH 4/9] CI: Ignore run-tools-test return value Anthony PERARD
2025-06-03 13:26 ` Andrew Cooper
2025-06-03 13:41 ` Marek Marczykowski-Górecki
2025-06-03 12:42 ` [XEN PATCH 5/9] CI: Have the gitlab job fail on tools/tests failure Anthony PERARD
2025-06-03 13:41 ` Andrew Cooper
2025-06-03 13:44 ` Marek Marczykowski-Górecki
2025-06-03 14:09 ` Andrew Cooper
2025-06-03 14:26 ` Andrew Cooper
2025-06-03 15:58 ` Anthony PERARD
2025-06-03 17:13 ` Andrew Cooper
2025-06-03 12:42 ` [XEN PATCH 6/9] CI: Upload junit result as artefact Anthony PERARD
2025-06-03 13:13 ` Andrew Cooper
2025-06-03 16:03 ` Anthony PERARD
2025-06-03 12:42 ` [XEN PATCH 7/9] CI: Use CDATA avoid the need to escape tests outputs Anthony PERARD
2025-06-03 13:04 ` Andrew Cooper
2025-06-03 18:27 ` Stefano Stabellini
2025-06-03 12:42 ` [XEN PATCH 8/9] CI: Workaround extra content in junit Anthony PERARD
2025-06-03 14:12 ` Andrew Cooper
2025-06-03 16:23 ` Anthony PERARD
2025-06-03 18:29 ` Stefano Stabellini
2025-06-03 18:37 ` Marek Marczykowski-Górecki
2025-06-03 21:49 ` Stefano Stabellini
2025-06-03 12:42 ` [XEN PATCH 9/9] CI: Add timing to junit Anthony PERARD
2025-06-03 14:16 ` Andrew Cooper
2025-06-03 18:35 ` Stefano Stabellini
2025-06-04 8:48 ` Anthony PERARD
2025-06-04 10:57 ` Andrew Cooper
2025-06-04 11:33 ` Marek Marczykowski-Górecki [this message]
2025-06-04 20:17 ` Stefano Stabellini
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=aEAu753_eexjZn08@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=anthony@xenproject.org \
--cc=cardoe@cardoe.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.