X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tools%2Fsysteminfo.py;h=50dc17e0ffa8b7d8070987cbd1a3193f1afc4905;hb=7ad56eff11393807085775f075fcc93640c26ce2;hp=9d8eb5cb69bda4a7c9fad41348c0533c5f95b087;hpb=dd47e4e2ea55f01235c20bed8e07d69fb51c292e;p=vswitchperf.git diff --git a/tools/systeminfo.py b/tools/systeminfo.py index 9d8eb5cb..50dc17e0 100644 --- a/tools/systeminfo.py +++ b/tools/systeminfo.py @@ -223,22 +223,45 @@ def get_version(app_name): app_git_tag = get_git_tag(S.getValue('OVS_DIR')) elif app_name.lower() in ['dpdk', 'testpmd']: tmp_ver = ['', '', ''] - found = False + dpdk_16 = False with open(app_version_file['dpdk']) as file_: for line in file_: if not line.strip(): continue + # DPDK version < 16 if line.startswith('#define RTE_VER_MAJOR'): - found = True tmp_ver[0] = line.rstrip('\n').split(' ')[2] - if line.startswith('#define RTE_VER_MINOR'): - found = True - tmp_ver[1] = line.rstrip('\n').split(' ')[2] - if line.startswith('#define RTE_VER_PATCH_LEVEL'): - found = True + # DPDK version < 16 + elif line.startswith('#define RTE_VER_PATCH_LEVEL'): tmp_ver[2] = line.rstrip('\n').split(' ')[2] - - if found: + # DPDK version < 16 + elif line.startswith('#define RTE_VER_PATCH_RELEASE'): + release = line.rstrip('\n').split(' ')[2] + if not '16' in release: + tmp_ver[2] += line.rstrip('\n').split(' ')[2] + # DPDK all versions + elif line.startswith('#define RTE_VER_MINOR'): + if dpdk_16: + tmp_ver[2] = line.rstrip('\n').split(' ')[2] + else: + tmp_ver[1] = line.rstrip('\n').split(' ')[2] + # DPDK all versions + elif line.startswith('#define RTE_VER_SUFFIX'): + tmp_ver[2] += line.rstrip('\n').split('"')[1] + # DPDK version >= 16 + elif line.startswith('#define RTE_VER_YEAR'): + dpdk_16 = True + tmp_ver[0] = line.rstrip('\n').split(' ')[2] + # DPDK version >= 16 + elif line.startswith('#define RTE_VER_MONTH'): + tmp_ver[1] = '{:0>2}'.format(line.rstrip('\n').split(' ')[2]) + # DPDK version >= 16 + elif line.startswith('#define RTE_VER_RELEASE'): + release = line.rstrip('\n').split(' ')[2] + if not '16' in release: + tmp_ver[2] += line.rstrip('\n').split(' ')[2] + + if len(tmp_ver[0]): app_version = '.'.join(tmp_ver) app_git_tag = get_git_tag(S.getValue('RTE_SDK')) elif app_name.lower().startswith('qemu'):