DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
To: dev@dpdk.org
Cc: Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,
	Pallavi Kadam <pallavi.kadam@intel.com>,
	Dmitry Malloy <dmitrym@microsoft.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Subject: [dpdk-dev] [PATCH v2 2/4] pmdinfogen: allow multiple input files
Date: Fri,  8 Jan 2021 05:47:21 +0300	[thread overview]
Message-ID: <20210108024723.26210-3-dmitry.kozliuk@gmail.com> (raw)
In-Reply-To: <20210108024723.26210-1-dmitry.kozliuk@gmail.com>

Process any number of input object files and write a unified output.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 buildtools/pmdinfogen.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
index 474168f21..965c08945 100755
--- a/buildtools/pmdinfogen.py
+++ b/buildtools/pmdinfogen.py
@@ -197,7 +197,9 @@ def dump_drivers(drivers, file):
 def parse_args():
     parser = argparse.ArgumentParser()
     parser.add_argument("format", help="object file format, 'elf' or 'coff'")
-    parser.add_argument("input", help="input object file path or '-' for stdin")
+    parser.add_argument(
+        "input", nargs='+', help="input object file path or '-' for stdin"
+    )
     parser.add_argument("output", help="output C file path or '-' for stdout")
     return parser.parse_args()
 
@@ -233,13 +235,16 @@ def open_output(path):
 
 def main():
     args = parse_args()
+    if args.input.count('-') > 1:
+        raise Exception("'-' input cannot be used multiple times")
     if args.format == "elf" and "ELFFile" not in globals():
         raise Exception("elftools module not found")
 
-    image = load_image(args.format, args.input)
-    drivers = load_drivers(image)
     output = open_output(args.output)
-    dump_drivers(drivers, output)
+    for path in args.input:
+        image = load_image(args.format, path)
+        drivers = load_drivers(image)
+        dump_drivers(drivers, output)
 
 
 if __name__ == "__main__":
-- 
2.29.2


  parent reply	other threads:[~2021-01-08  2:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12 23:34 [dpdk-dev] [PATCH 0/4] pmdinfogen: support Windows Dmitry Kozlyuk
2020-12-12 23:34 ` [dpdk-dev] [PATCH 1/4] pmdinfogen: support COFF Dmitry Kozlyuk
2020-12-12 23:34 ` [dpdk-dev] [PATCH 2/4] pmdinfogen: allow multiple input files Dmitry Kozlyuk
2020-12-12 23:34 ` [dpdk-dev] [PATCH 3/4] buildtools: support object file extraction for Windows Dmitry Kozlyuk
2020-12-12 23:34 ` [dpdk-dev] [PATCH 4/4] build: enable pmdinfogen " Dmitry Kozlyuk
2021-01-08  2:47 ` [dpdk-dev] [PATCH v2 0/4] pmdinfogen: support Windows Dmitry Kozlyuk
2021-01-08  2:47   ` [dpdk-dev] [PATCH v2 1/4] pmdinfogen: support COFF Dmitry Kozlyuk
2021-01-08  2:47   ` Dmitry Kozlyuk [this message]
2021-01-08  2:47   ` [dpdk-dev] [PATCH v2 3/4] buildtools: support object file extraction for Windows Dmitry Kozlyuk
2021-01-25 15:57     ` Thomas Monjalon
2021-01-08  2:47   ` [dpdk-dev] [PATCH v2 4/4] build: enable pmdinfogen " Dmitry Kozlyuk
2021-01-08 18:29     ` Jie Zhou
2021-01-25 15:59   ` [dpdk-dev] [PATCH v2 0/4] pmdinfogen: support Windows Thomas Monjalon

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=20210108024723.26210-3-dmitry.kozliuk@gmail.com \
    --to=dmitry.kozliuk@gmail.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitrym@microsoft.com \
    --cc=navasile@linux.microsoft.com \
    --cc=nhorman@tuxdriver.com \
    --cc=pallavi.kadam@intel.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).