From c18cd89b718a664b4c31c29c8eaa573360d8670c Mon Sep 17 00:00:00 2001 From: Yanray Wang Date: Wed, 31 May 2023 11:08:04 +0800 Subject: [PATCH] code_size_compare.py: add prompt for unsupported arch and config Add prompt message for a series of supported combination of architecture and configuration when someone tries unsupported combinations. Signed-off-by: Yanray Wang --- scripts/code_size_compare.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/code_size_compare.py b/scripts/code_size_compare.py index e61236ad3c..b8f29422d4 100755 --- a/scripts/code_size_compare.py +++ b/scripts/code_size_compare.py @@ -71,6 +71,14 @@ class CodeSizeInfo: # pylint: disable=too-few-public-methods infer build command for code size measurement. """ + SupportedArchConfig = [ + "-a " + SupportedArch.AARCH64.value + " -c " + SupportedConfig.DEFAULT.value, + "-a " + SupportedArch.AARCH32.value + " -c " + SupportedConfig.DEFAULT.value, + "-a " + SupportedArch.X86_64.value + " -c " + SupportedConfig.DEFAULT.value, + "-a " + SupportedArch.X86.value + " -c " + SupportedConfig.DEFAULT.value, + "-a " + SupportedArch.ARMV8_M.value + " -c " + SupportedConfig.TFM_MEDIUM.value, + ] + def __init__(self, arch: str, config: str) -> None: """ arch: architecture to measure code size on. @@ -96,6 +104,9 @@ class CodeSizeInfo: # pylint: disable=too-few-public-methods else: print("Unsupported architecture: {} and configurations: {}" .format(self.arch, self.config)) + print("\nPlease use supported combination of architecture and configuration:") + for comb in CodeSizeInfo.SupportedArchConfig: + print(comb) sys.exit(1)