DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Mingjin Ye <mingjinx.ye@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,
	 Ali Alnubani <alialnu@nvidia.com>
Subject: Re: [PATCH v2] buildtools: fix invalid symbols
Date: Wed, 3 Jul 2024 18:13:23 +0200	[thread overview]
Message-ID: <CAJFAV8yi-Lh+Yc75qb=JyEFtv4ECcZibodbp4pzzgZ_DbJ_U3A@mail.gmail.com> (raw)
In-Reply-To: <20240701103315.835249-1-mingjinx.ye@intel.com>

Adding Ali in the loop, as he was working on a similar patch.

On Mon, Jul 1, 2024 at 12:56 PM Mingjin Ye <mingjinx.ye@intel.com> wrote:
>
> Elf files generated by higher version compilers wrap multiple
> symbols prefixed with "this_pmd_name".
>
> The patch uses the regex "^this_pmd_name[0-9]+$" to match the
> symbol name.
>
> Bugzilla ID: 1466
> Fixes: 6c4bf8f42432 ("buildtools: add Python pmdinfogen")
> Cc: stable@dpdk.org
>
> Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
> ---
> v2: Use regex ^this_pmd_name[0-9]+$ to filter symbols *names*
> ---
>  buildtools/pmdinfogen.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
> index 2a44f17bda..0fbcc697ed 100755
> --- a/buildtools/pmdinfogen.py
> +++ b/buildtools/pmdinfogen.py
> @@ -6,6 +6,7 @@
>  import argparse
>  import ctypes
>  import json
> +import re
>  import sys
>  import tempfile
>
> @@ -70,7 +71,7 @@ def find_by_prefix(self, prefix):

This function does not find symbols with a prefix anymore...
Please rename.


>          prefix = prefix.encode("utf-8") if self._legacy_elftools else prefix
>          for i in range(self._symtab.num_symbols()):
>              symbol = self._symtab.get_symbol(i)
> -            if symbol.name.startswith(prefix):
> +            if re.match(prefix, symbol.name):
>                  yield ELFSymbol(self._image, symbol)
>
>
> @@ -199,7 +200,7 @@ def dump(self, file):
>
>  def load_drivers(image):
>      drivers = []
> -    for symbol in image.find_by_prefix("this_pmd_name"):
> +    for symbol in image.find_by_prefix("^this_pmd_name[0-9]+$"):
>          drivers.append(Driver.load(image, symbol))
>      return drivers

The COFF implementation is probably broken by this change as it is
still filtering symbols with a prefix.
Please update.


-- 
David Marchand


  parent reply	other threads:[~2024-07-03 16:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 10:11 [PATCH] " Mingjin Ye
2024-06-27 10:50 ` Bruce Richardson
2024-06-27 12:39   ` David Marchand
2024-06-27 11:30 ` David Marchand
2024-07-01 10:33 ` [PATCH v2] " Mingjin Ye
2024-07-03  1:30   ` Jiale, SongX
2024-07-03 16:13   ` David Marchand [this message]
2024-07-05  8:25   ` [PATCH v3] " Mingjin Ye
2024-07-05 18:08     ` Ali Alnubani

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='CAJFAV8yi-Lh+Yc75qb=JyEFtv4ECcZibodbp4pzzgZ_DbJ_U3A@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=alialnu@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=mingjinx.ye@intel.com \
    --cc=stable@dpdk.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 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).