]> rtime.felk.cvut.cz Git - linux-conf-perf.git/blob - conf.py
Add bbb target for BeagleBone Black
[linux-conf-perf.git] / conf.py
1 import os
2 import sys
3 import re
4 import importlib.machinery
5
6 ## Global configs
7 # kernel_arch
8 # This defines environment variable ARCH for linux kernel.
9 # Change this to change target architecture
10 kernel_arch = 'x86'
11
12 # kernle_env
13 # Enviroment variables for Linux
14 kernel_env = {'SRCARCH': kernel_arch, 'ARCH': kernel_arch, 'KERNELVERSION': kernel_arch}
15 # build_command
16 # Command executed for kernel build in linux folder.
17 build_command = ['make']
18
19 # boot_command
20 # Command executed for booting. Output of this command is saved to output folder.
21 boot_command = ['echo', 'bootit']
22 # boot_timeout
23 # Set timeout of boot process if no output is generated for selected seconds
24 boot_timeout = 120
25
26 # parse_command
27 # Command to parse double value from boot output
28 parse_command = ['echo', '0']
29
30 # measurement_identifier
31 # Identifier of measurement can consist of measure tool name and version
32 measure_identifier = 'cyclictest-v0.92'
33
34 # picosat_args
35 # Additional arguments passed to PicoSAT.
36 picosat_args = []
37
38 # db_database
39 # Database in PostgreSQL to be used for this tools
40 db_database = 'linux-conf-perf'
41 # db_user
42 # Define PostgreSQL user
43 db_user = 'user'
44 # db_password
45 # Define PostrgreSQL user password
46 db_password = 'password'
47 # db_host
48 # Address of PostgreSQL database server
49 db_host = 'localhost'
50 # db_port
51 # Port of PotgreSQL database server
52 db_port = 5432
53
54 # multithread
55 # Define if measurement and kernel build should be executed in parallel.
56 multithread = False
57 # multithread_buffer
58 # Defines maximal number of buffered configurations before generating is suspended.
59 multithread_buffer = 32
60
61 # git_describe_cmd
62 # Command used for getting tools version and status from git
63 git_describe_cmd = ['git', 'describe', '--always', '--tags', '--dirty']
64 # git_commit_cmd
65 # Command used for getting commit hash from git
66 git_commit_cmd = ['git', 'rev-parse', '--verify', 'HEAD']
67
68 ## Programs output show/hide
69 # These options hides output of launched programs from terminal.
70 # If variable is True, output is printed. Otherwise is hidden.
71 # What ever are these settings, output is always written to files in folder log.
72 parse_kconfig_output = False
73 picosat_output = False
74 kernel_config_output = True
75 kernel_make_output = True
76 boot_output = True
77 parse_output = False
78
79 ## Configs for debugging
80 single_loop = False # Executes only one loop and exits.
81 only_config = False # Executes only to configuration phase. Building and booting phases are skipped.
82 ignore_misconfig = False # Ignore if configuration wasn't applied correctly.
83 #######################################
84 # Most probably you don't want touch rest of these.
85 ## Path settings
86 dot_confmk = '.conf.mk'
87 dot_config = 'dot_config'
88
89 linux_sources = 'linux/'
90 linux_build_folder = 'linux/'
91 linux_image = linux_build_folder + 'arch/' + kernel_arch + '/boot/bzImage'
92
93 build_folder = 'jobfiles/'
94 jobfolder_linux_image = build_folder + 'linuxImage'
95 symbol_map_file = build_folder + 'symbol_map' # Also defined in parse_kconfig
96 rules_file = build_folder + 'rules' # Also defined in parse_kconfig
97 variable_count_file = build_folder + 'variable_count' # Also defined in parse_kconfig
98 fixed_file = build_folder + 'fixed'
99 measure_file = build_folder + 'measure'
100 dot_measure_file = build_folder + 'dot_measure'
101 dot_config_back_file = build_folder + 'dot_config_back'
102 single_generated_file = build_folder + 'single_generated'
103 measurechecked_file = build_folder + 'measurechecked'
104
105 buildroot_config_cyclictest = '/dev/null'
106
107 result_folder = 'result/'
108 log_folder = 'log/'
109
110 ## Programs paths
111 parse_kconfig = 'scripts/parse_kconfig/parse'
112 write_config = 'scripts/write_config/write_config'
113 picosat = 'scripts/picosat-959/picosat'
114 allconfig = 'scripts/allconfig/allconfig'
115
116 #######################################
117 absroot = os.path.dirname(os.path.realpath(__file__))
118
119 #######################################
120 # Overlap configuration for specified target
121 if os.path.isfile(os.path.join(absroot, '.target')):
122         target = None
123         with open(os.path.join(absroot, '.target'), 'r') as f:
124                 target = f.readline().rstrip()
125         conffile = os.path.join(absroot, 'targets', target, 'conf.py')
126         if os.path.isfile(conffile):
127                 ovconf = importlib.machinery.SourceFileLoader("module.name", conffile).load_module()
128                 for name in dir(ovconf):
129                         if not re.match('__*__', name):
130                                 vars()[name] = vars(ovconf)[name]
131         else:
132                 print("E: Invalid target specifier. Write valid target to .target file.")
133                 sys.exit(-99)
134 else:
135         print("E: No target specifier. Write target to .target file.")
136         sys.exit(-99)