aboutsummaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen/vppapigen_c.py
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2022-06-16 17:00:02 +0200
committerBeno�t Ganne <bganne@cisco.com>2022-08-05 08:33:10 +0000
commit1b299fa46707aa29da6f19f909fcfe354996b8cc (patch)
treef1f60106a3e25cd4a802416acf6c9ea92354a776 /src/tools/vppapigen/vppapigen_c.py
parent7ea7ab5f215a95dbc1a38acc03b7fea6d3dbedcf (diff)
vppapigen: make json in parallel
Type: improvement This patches makes the make json-api-files run in parallel in the same python runtime. Default number of workers is 8, and run time goes from ~20s to ~2s on average. Change-Id: Id8cff013889db2671f6b6b4af9a019460c656f81 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/tools/vppapigen/vppapigen_c.py')
-rw-r--r--src/tools/vppapigen/vppapigen_c.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py
index fdbb7270a8a..a065653e391 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -2010,24 +2010,24 @@ def generate_c_test2_boilerplate(services, defines, module, stream):
#
# Plugin entry point
#
-def run(args, apifilename, s):
+def run(output_dir, apifilename, s):
"""Main plugin entry point."""
stream = StringIO()
- if not args.outputdir:
+ if not output_dir:
sys.stderr.write("Missing --outputdir argument")
return None
basename = os.path.basename(apifilename)
filename, _ = os.path.splitext(basename)
modulename = filename.replace(".", "_")
- filename_enum = os.path.join(args.outputdir + "/" + basename + "_enum.h")
- filename_types = os.path.join(args.outputdir + "/" + basename + "_types.h")
- filename_c = os.path.join(args.outputdir + "/" + basename + ".c")
- filename_c_test = os.path.join(args.outputdir + "/" + basename + "_test.c")
- filename_c_test2 = os.path.join(args.outputdir + "/" + basename + "_test2.c")
- filename_c_tojson = os.path.join(args.outputdir + "/" + basename + "_tojson.h")
- filename_c_fromjson = os.path.join(args.outputdir + "/" + basename + "_fromjson.h")
+ filename_enum = os.path.join(output_dir + "/" + basename + "_enum.h")
+ filename_types = os.path.join(output_dir + "/" + basename + "_types.h")
+ filename_c = os.path.join(output_dir + "/" + basename + ".c")
+ filename_c_test = os.path.join(output_dir + "/" + basename + "_test.c")
+ filename_c_test2 = os.path.join(output_dir + "/" + basename + "_test2.c")
+ filename_c_tojson = os.path.join(output_dir + "/" + basename + "_tojson.h")
+ filename_c_fromjson = os.path.join(output_dir + "/" + basename + "_fromjson.h")
# Generate separate types file
st = StringIO()