DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicholas Pratte <npratte@iol.unh.edu>
To: Jeremy Spewock <jspewock@iol.unh.edu>
Cc: thomas@monjalon.net, yoan.picchi@foss.arm.com,
	paul.szczepanek@arm.com,  Honnappa.Nagarahalli@arm.com,
	probb@iol.unh.edu, wathsala.vithanage@arm.com,
	 Luca.Vizzarro@arm.com, juraj.linkes@pantheon.tech,
	alex.chapman@arm.com,  dev@dpdk.org
Subject: Re: [PATCH v3 1/1] dts: add text parser for testpmd verbose output
Date: Mon, 12 Aug 2024 13:32:18 -0400	[thread overview]
Message-ID: <CAKXZ7ehp-Hh_w_Mqt91LxxrgFeJg+3fbF5zasZHMzy802fMY=w@mail.gmail.com> (raw)
In-Reply-To: <CAAA20UTBkZMDxHZ1Ne3ooryEK0uoYcqcFgkh2iwhupsV+hNQJw@mail.gmail.com>

Great work!

I think it'd be fine to just keep if you ask me, I could see this
being used in the future. I'm also looking at it from the perspective
of 'what if i would have to write this myself,' if it turns out that
we need it again for something later. It's easier to remove later if
it turns out we aren't using it, but it'd likely be more
time-consuming to remove it now and implement it again later,
considering that time has already been spent testing and building it.

On Thu, Aug 8, 2024 at 5:49 PM Jeremy Spewock <jspewock@iol.unh.edu> wrote:
>
> On Thu, Aug 8, 2024 at 4:36 PM <jspewock@iol.unh.edu> wrote:
> >
> > From: Jeremy Spewock <jspewock@iol.unh.edu>
> >
> > Multiple test suites from the old DTS framework rely on being able to
> > consume and interpret the verbose output of testpmd. The new framework
> > doesn't have an elegant way for handling the verbose output, but test
> > suites are starting to be written that rely on it. This patch creates a
> > TextParser class that can be used to extract the verbose information
> > from any testpmd output and also adjusts the `stop` method of the shell
> > to return all output that it collected.
> >
> > Signed-off-by: Jeremy Spewock <jspewock@iol.unh.edu>
> > ---
> >  dts/framework/parser.py                       |  30 ++
> >  dts/framework/remote_session/testpmd_shell.py | 405 +++++++++++++++++-
> >  dts/framework/utils.py                        |   1 +
> >  3 files changed, 434 insertions(+), 2 deletions(-)
> >
> > diff --git a/dts/framework/parser.py b/dts/framework/parser.py
> > index 741dfff821..0b39025a48 100644
> > --- a/dts/framework/parser.py
> > +++ b/dts/framework/parser.py
> > @@ -160,6 +160,36 @@ def _find(text: str) -> Any:
> >
> >          return ParserFn(TextParser_fn=_find)
> >
> > +    @staticmethod
> > +    def find_all(
>
> I just realized that I forgot to take this method out since it is no
> longer used in this patch now that I removed the idea of a block of
> output that contains a burst of packets. The method could still be
> useful in the future, but it isn't used anywhere now, so I can remove
> it in the next version if no one sees a use for it. I'm also open to
> leaving it there for the "just in case" it is needed in the future.
> What do you all think?
>
> > +        pattern: str | re.Pattern[str],
> > +        flags: re.RegexFlag = re.RegexFlag(0),
> > +    ) -> ParserFn:
> > +        """Makes a parser function that finds all of the regular expression matches in the text.
> > +
> > +        If there are no matches found in the text than None will be returned, otherwise a list
> > +        containing all matches will be returned. Patterns that contain multiple groups will pack
> > +        the matches for each group into a tuple.
> > +
> > +        Args:
> > +            pattern: The regular expression pattern.
> > +            flags: The regular expression flags. Ignored if the given pattern is already compiled.
> > +
> > +        Returns:
> > +            A :class:`ParserFn` that can be used as metadata for a dataclass field.
> > +        """
> > +        if isinstance(pattern, str):
> > +            pattern = re.compile(pattern, flags)
> > +
> > +        def _find_all(text: str) -> list[str] | None:
> > +            m = pattern.findall(text)
> > +            if len(m) == 0:
> > +                return None
> > +
> > +            return m
> > +
> > +        return ParserFn(TextParser_fn=_find_all)
> > +
> <snip>
> > 2.45.2
> >

  reply	other threads:[~2024-08-12 17:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-29 20:39 [PATCH v1 0/1] dts: testpmd verbose parser jspewock
2024-07-29 20:39 ` [PATCH v1 1/1] dts: add text parser for testpmd verbose output jspewock
2024-07-30 13:34 ` [PATCH v2 0/1] dts: testpmd verbose parser jspewock
2024-07-30 13:34   ` [PATCH v2 1/1] dts: add text parser for testpmd verbose output jspewock
2024-07-30 15:41     ` Nicholas Pratte
2024-07-30 21:30       ` Jeremy Spewock
2024-08-02 14:54         ` Nicholas Pratte
2024-08-02 17:38           ` Jeremy Spewock
2024-08-05 13:20             ` Nicholas Pratte
2024-07-30 21:33     ` Jeremy Spewock
2024-08-01  8:43       ` Luca Vizzarro
2024-08-02 13:40         ` Jeremy Spewock
2024-08-01  8:41     ` Luca Vizzarro
2024-08-02 13:35       ` Jeremy Spewock
2024-08-08 20:36 ` [PATCH v3 0/1] dts: testpmd verbose parser jspewock
2024-08-08 20:36   ` [PATCH v3 1/1] dts: add text parser for testpmd verbose output jspewock
2024-08-08 21:49     ` Jeremy Spewock
2024-08-12 17:32       ` Nicholas Pratte [this message]
2024-09-09 11:44     ` Juraj Linkeš
2024-09-17 13:40       ` Jeremy Spewock
2024-09-18  8:09         ` Juraj Linkeš
2024-09-18 16:34 ` [PATCH v4 0/1] dts: testpmd verbose parser jspewock
2024-09-18 16:34   ` [PATCH v4 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-18 17:05 ` [PATCH v5 0/1] dts: testpmd verbose parser jspewock
2024-09-18 17:05   ` [PATCH v5 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-19  9:02     ` Juraj Linkeš
2024-09-20 15:53       ` Jeremy Spewock
2024-09-23 13:30         ` Juraj Linkeš
2024-09-19 12:35     ` Juraj Linkeš
2024-09-20 15:55       ` Jeremy Spewock
2024-09-25 15:46 ` [PATCH v6 0/1] dts: testpmd verbose parser jspewock
2024-09-25 15:46   ` [PATCH v6 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-26  8:25     ` Juraj Linkeš
2024-09-26 14:43       ` Jeremy Spewock
2024-09-26 15:47 ` [PATCH v7 0/1] dts: testpmd verbose parser jspewock
2024-09-26 15:47   ` [PATCH v7 1/1] dts: add text parser for testpmd verbose output jspewock
2024-09-27  9:32     ` Juraj Linkeš
2024-09-27 11:48     ` Luca Vizzarro
2024-09-30 13:41     ` Juraj Linkeš

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='CAKXZ7ehp-Hh_w_Mqt91LxxrgFeJg+3fbF5zasZHMzy802fMY=w@mail.gmail.com' \
    --to=npratte@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=jspewock@iol.unh.edu \
    --cc=juraj.linkes@pantheon.tech \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --cc=yoan.picchi@foss.arm.com \
    /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 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).