[dpdk-dev] [PATCH 2/4] pmdinfogen: allow multiple input files

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Sun Dec 13 00:34:45 CET 2020


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

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk at gmail.com>
---
Used in the next patch, separated for clarity.

 buildtools/pmdinfogen.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/buildtools/pmdinfogen.py b/buildtools/pmdinfogen.py
index 65d78b872..3209510eb 100755
--- a/buildtools/pmdinfogen.py
+++ b/buildtools/pmdinfogen.py
@@ -194,7 +194,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()
 
@@ -230,10 +232,14 @@ def open_output(path):
 
 def main():
     args = parse_args()
-    image = load_image(args.format, args.input)
-    drivers = load_drivers(image)
+    if args.input.count('-') > 1:
+        raise Exception("'-' input cannot be used multiple times")
+
     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



More information about the dev mailing list