summaryrefslogtreecommitdiffstats
path: root/linux_dpdk
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-12-14 16:03:27 +0200
committerHanoh Haim <hhaim@cisco.com>2015-12-14 16:03:27 +0200
commita3611f0f06cb8fca0692eab5e4aafd5827fb88cc (patch)
tree3094b889a322dd4655a6b48a4630b92c81809db5 /linux_dpdk
parent4e0f17da4400a9db25a4919242000ec44fa03763 (diff)
parent3f94a09f66657970636a532aac9411ad6a5290ad (diff)
merge from master
Diffstat (limited to 'linux_dpdk')
-rwxr-xr-xlinux_dpdk/ws_main.py18
-rwxr-xr-xlinux_dpdk/wscript3
2 files changed, 21 insertions, 0 deletions
diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py
index 89f41376..e5ac40fb 100755
--- a/linux_dpdk/ws_main.py
+++ b/linux_dpdk/ws_main.py
@@ -12,6 +12,7 @@ import shutil;
import copy;
import re
import uuid
+import subprocess
# these variables are mandatory ('/' are converted automatically)
@@ -95,6 +96,7 @@ main_src = SrcGroup(dir='src',
'global_io_mode.cpp',
'main_dpdk.cpp',
'bp_sim.cpp',
+ 'latency.cpp',
'platform_cfg.cpp',
'tuple_gen.cpp',
'rx_check.cpp',
@@ -701,6 +703,15 @@ def get_build_num ():
return s;
def create_version_files ():
+ git_sha="N/A"
+ try:
+ r=commands.getstatusoutput("git log --pretty=format:'%H' -n 1")
+ if r[0]==0:
+ git_sha=r[1]
+ except :
+ pass;
+
+
s =''
s +="#ifndef __TREX_VER_FILE__ \n"
s +="#define __TREX_VER_FILE__ \n"
@@ -711,6 +722,7 @@ def create_version_files ():
s +='extern const char * get_build_date(void); \n'
s +='extern const char * get_build_time(void); \n'
s +='#define VERSION_UIID "%s" \n' % uuid.uuid1()
+ s +='#define VERSION_GIT_SHA "%s" \n' % git_sha
s +='#define VERSION_BUILD_NUM "%s" \n' % get_build_num()
s +="#ifdef __cplusplus \n"
s +=" } \n"
@@ -876,6 +888,12 @@ def publish_ext(bld):
+def test (bld):
+ r=commands.getstatusoutput("git log --pretty=format:'%H' -n 1")
+ if r[0]==0:
+ print r[1]
+
+
diff --git a/linux_dpdk/wscript b/linux_dpdk/wscript
index be048bd8..459e2201 100755
--- a/linux_dpdk/wscript
+++ b/linux_dpdk/wscript
@@ -45,6 +45,9 @@ def publish_web(bld):
def sync(bld):
ws_main.sync(bld)
+def test(bld):
+ ws_main.test(bld)
+