test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing
@ 2024-09-16  4:26 Patrick Robb
  2024-09-16  7:16 ` David Marchand
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick Robb @ 2024-09-16  4:26 UTC (permalink / raw)
  To: david.marchand; +Cc: dts, Patrick Robb

This testsuite fails to parse lscpu output on some systems because
it expects that there be no leading whitespace, which is not
true on all systems.

Signed-off-by: Patrick Robb <probb@iol.unh.edu>
---
 tests/TestSuite_crypto_perf_cryptodev_perf.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/TestSuite_crypto_perf_cryptodev_perf.py b/tests/TestSuite_crypto_perf_cryptodev_perf.py
index 0531b9c677da..a6b611d7956d 100644
--- a/tests/TestSuite_crypto_perf_cryptodev_perf.py
+++ b/tests/TestSuite_crypto_perf_cryptodev_perf.py
@@ -330,6 +330,7 @@ class TestCryptoPerfCryptodevPerf(TestCase):
             elif "Vulnerability" in each_line:
                 continue
             key, value = each_line.split(":")
+            key = key.strip()
             cpu_info[key] = value.strip()
         core, thread = 0, 0
         lcores = self.get_case_cfg()["l"].split(",")
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing
  2024-09-16  4:26 [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing Patrick Robb
@ 2024-09-16  7:16 ` David Marchand
  2024-09-17  3:36   ` Patrick Robb
  2024-09-18  7:16   ` David Marchand
  0 siblings, 2 replies; 5+ messages in thread
From: David Marchand @ 2024-09-16  7:16 UTC (permalink / raw)
  To: Patrick Robb; +Cc: dts, Thomas Monjalon, Aaron Conole

On Mon, Sep 16, 2024 at 6:27 AM Patrick Robb <probb@iol.unh.edu> wrote:
>
> This testsuite fails to parse lscpu output on some systems because
> it expects that there be no leading whitespace, which is not
> true on all systems.

The leading whitespace is a generic issue, not really related to "some" systems.
The issue is that keys of interest for the rest of the code ('Core(s)
per socket', 'Socket(s)', 'CPU(s)') may have leading whitespace on
some systems.

Could you detail which systems have such issue?

In any case, this fix makes sense to me and it seems limited and safe
enough to merge the patch in the "legacy" repository for dts.


>
> Signed-off-by: Patrick Robb <probb@iol.unh.edu>

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing
  2024-09-16  7:16 ` David Marchand
@ 2024-09-17  3:36   ` Patrick Robb
  2024-09-18  7:01     ` David Marchand
  2024-09-18  7:16   ` David Marchand
  1 sibling, 1 reply; 5+ messages in thread
From: Patrick Robb @ 2024-09-17  3:36 UTC (permalink / raw)
  To: David Marchand; +Cc: dts, Thomas Monjalon, Aaron Conole

On Mon, Sep 16, 2024 at 3:17 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Mon, Sep 16, 2024 at 6:27 AM Patrick Robb <probb@iol.unh.edu> wrote:
> >
> > This testsuite fails to parse lscpu output on some systems because
> > it expects that there be no leading whitespace, which is not
> > true on all systems.
>
> The leading whitespace is a generic issue, not really related to "some" systems.
> The issue is that keys of interest for the rest of the code ('Core(s)
> per socket', 'Socket(s)', 'CPU(s)') may have leading whitespace on
> some systems.

^The above is what I had in mind when writing my commit - your wording
gets to the point better, thanks.

I had observed this issue in trying to run the testsuite on an ARM
Neoverse N-1 Ampere server at UNH, and noted that the leading
whitespace on it's lscpu output was preventing the 'Core(s) per
socket' key from appearing in the output dict (at least without the
trimming which this commit provides).

>
> Could you detail which systems have such issue?
>

From a quick look through of our systems I think that there appears to
be a mixture of systems with lscpu output with no leading whitespace
before any of the keys, and others (like the Ampere server I
mentioned) which do have that leading whitespace/indentation. I'm not
sure what the pattern is (I guess it probably depends on the OS on the
system), and a google search didn't seem to reveal much about this
question. However, from looking at the lscpu man page, I do see that
there is a --json flag which you can include.

So, in my opinion the ideal way to deal with these situation where you
must read some information from the system, is to use the options
available (like lscpu --json) which are guaranteed to return a machine
readable output. Getting into the business of reading text output like
this is not ideal, given that it is subject to change in the future.
But, I have the same view as you that this commit is not likely to
break this testsuite for any systems which are running the suite
currently, it will only help for systems with the indented lscpu
output.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing
  2024-09-17  3:36   ` Patrick Robb
@ 2024-09-18  7:01     ` David Marchand
  0 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2024-09-18  7:01 UTC (permalink / raw)
  To: Patrick Robb; +Cc: dts, Thomas Monjalon, Aaron Conole

On Tue, Sep 17, 2024 at 5:37 AM Patrick Robb <probb@iol.unh.edu> wrote:
>
> On Mon, Sep 16, 2024 at 3:17 AM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Mon, Sep 16, 2024 at 6:27 AM Patrick Robb <probb@iol.unh.edu> wrote:
> > >
> > > This testsuite fails to parse lscpu output on some systems because
> > > it expects that there be no leading whitespace, which is not
> > > true on all systems.
> >
> > The leading whitespace is a generic issue, not really related to "some" systems.
> > The issue is that keys of interest for the rest of the code ('Core(s)
> > per socket', 'Socket(s)', 'CPU(s)') may have leading whitespace on
> > some systems.
>
> ^The above is what I had in mind when writing my commit - your wording
> gets to the point better, thanks.
>
> I had observed this issue in trying to run the testsuite on an ARM
> Neoverse N-1 Ampere server at UNH, and noted that the leading
> whitespace on it's lscpu output was preventing the 'Core(s) per
> socket' key from appearing in the output dict (at least without the
> trimming which this commit provides).

Thank you for confirming, I'll update the commitlog accordingly before applying.

>
> >
> > Could you detail which systems have such issue?
> >
>
> From a quick look through of our systems I think that there appears to
> be a mixture of systems with lscpu output with no leading whitespace
> before any of the keys, and others (like the Ampere server I
> mentioned) which do have that leading whitespace/indentation. I'm not
> sure what the pattern is (I guess it probably depends on the OS on the
> system), and a google search didn't seem to reveal much about this
> question. However, from looking at the lscpu man page, I do see that

Ok, there is no point in investigating more from my pov.
I'll just mention that some ARM env were affected.


> there is a --json flag which you can include.
>
> So, in my opinion the ideal way to deal with these situation where you
> must read some information from the system, is to use the options
> available (like lscpu --json) which are guaranteed to return a machine
> readable output. Getting into the business of reading text output like
> this is not ideal, given that it is subject to change in the future.

This would be a more robust solution, but I guess this is beyond the
simple fixing that we want to do on this "legacy" repository.
Hopefully, the new DTS code in the DPDK repo won't be subject to such issue.


> But, I have the same view as you that this commit is not likely to
> break this testsuite for any systems which are running the suite
> currently, it will only help for systems with the indented lscpu
> output.

+1


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing
  2024-09-16  7:16 ` David Marchand
  2024-09-17  3:36   ` Patrick Robb
@ 2024-09-18  7:16   ` David Marchand
  1 sibling, 0 replies; 5+ messages in thread
From: David Marchand @ 2024-09-18  7:16 UTC (permalink / raw)
  To: Patrick Robb; +Cc: dts, Thomas Monjalon, Aaron Conole

On Mon, Sep 16, 2024 at 9:16 AM David Marchand
<david.marchand@redhat.com> wrote:
> On Mon, Sep 16, 2024 at 6:27 AM Patrick Robb <probb@iol.unh.edu> wrote:
> >
> > This testsuite fails to parse lscpu output on some systems because
> > it expects that there be no leading whitespace, which is not
> > true on all systems.
> >
> > Signed-off-by: Patrick Robb <probb@iol.unh.edu>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied with some update on the commitlog.
Thanks Patrick.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-18  7:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-16  4:26 [PATCH] tests/TestSuite_crypto_perf_cryptodev_perf.py Improving lscpu parsing Patrick Robb
2024-09-16  7:16 ` David Marchand
2024-09-17  3:36   ` Patrick Robb
2024-09-18  7:01     ` David Marchand
2024-09-18  7:16   ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).