import sys
import re
import importlib.machinery
+import multiprocessing
## Global configs
# kernel_arch
kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kernel_arch}
# build_command
# Command executed for kernel build in linux folder.
-build_command = ['make']
+build_command = ['make', '-j', str(multiprocessing.cpu_count())]
# boot_command
# Command executed for booting. Output of this command is saved to output folder.
# db_database
# Database in PostgreSQL to be used for this tools
db_database = 'linux-conf-perf'
-# db_user
-# Define PostgreSQL user
-db_user = 'user'
-# db_password
-# Define PostrgreSQL user password
-db_password = 'password'
-# db_host
-# Address of PostgreSQL database server
-db_host = 'localhost'
-# db_port
-# Port of PotgreSQL database server
-db_port = 5432
+
+# # db_user
+# # Define PostgreSQL user
+# db_user = 'user'
+# # db_password
+# # Define PostrgreSQL user password
+# db_password = 'password'
+# # db_host
+# # Address of PostgreSQL database server
+# db_host = 'localhost'
+# # db_port
+# # Port of PotgreSQL database server
+# db_port = 5432
# multithread
# Define if measurement and kernel build should be executed in parallel.
absroot = os.path.dirname(os.path.realpath(__file__))
#######################################
-# Overlap configuration for specified target
-if os.path.isfile(os.path.join(absroot, '.target')):
- target = None
- with open(os.path.join(absroot, '.target'), 'r') as f:
- target = f.readline().rstrip()
+# Override configuration for specified target
+try:
+ target = open(os.path.join(absroot, '.target'), 'r').readline().rstrip()
conffile = os.path.join(absroot, 'targets', target, 'conf.py')
- if os.path.isfile(conffile):
+ try:
ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
for name in dir(ovconf):
if not re.match('__*__', name):
vars()[name] = vars(ovconf)[name]
- else:
+ except:
print("E: Invalid target specifier. Write valid target to .target file.")
sys.exit(-99)
-else:
+except:
print("E: No target specifier. Write target to .target file.")
sys.exit(-99)