Skip to content

Commit abb1045

Browse files
author
vrbagalkot
committed
[V2]Reduce the compile time,by doing Multithreaded compilation
Making use of built in functions to compile Signed-off-by: vrbagalkot <[email protected]>
1 parent c959b8c commit abb1045

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

kernel/kselftest.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ def setUp(self):
131131

132132
self.sourcedir = os.path.join(self.buldir, self.testdir)
133133
if (self.comp != "cpufreq" and self.comp != "bpf"):
134-
process.system("make headers -C %s" % self.buldir, shell=True,
135-
sudo=True)
136-
process.system("make install -C %s" % self.sourcedir,
137-
shell=True, sudo=True)
134+
build.make(path =self.buldir, make="make",
135+
extra_args=f" headers -C {self.buldir}")
136+
build.make(path=self.sourcedir, make="make",
137+
extra_args=f" install -C {self.sourcedir}")
138138
else:
139139
self.buldir = self.params.get('location', default='')
140140
else:
@@ -178,7 +178,7 @@ def setUp(self):
178178
if (self.comp != "cpufreq" and self.comp != "bpf"):
179179
if self.comp:
180180
build_str = '-C %s' % self.comp
181-
if build.make(self.sourcedir, extra_args='%s' % build_str):
181+
if build.make(path=self.sourcedir, extra_args=f" {build_str}"):
182182
self.fail("Compilation failed, Please check the build logs !!")
183183

184184
def test(self):
@@ -199,9 +199,8 @@ def test(self):
199199
test_comp = self.comp + "/" + self.subtest
200200
else:
201201
test_comp = self.comp
202-
make_cmd = 'make -C %s %s -C %s run_tests' % (
203-
self.sourcedir, kself_args, test_comp)
204-
self.result = process.run(make_cmd, shell=True, ignore_status=True)
202+
args = '-C %s %s -C %s run_tests'%(self.sourcedir, kself_args, test_comp)
203+
self.result = build.run_make(path=self.sourcedir, extra_args=f" {args}")
205204
log_output = self.result.stdout.decode('utf-8')
206205
results_path = os.path.join(self.outputdir, 'raw_output')
207206
with open(results_path, 'w') as r_file:
@@ -260,7 +259,6 @@ def bpf(self):
260259
"""
261260
self.sourcedir = os.path.join(self.buldir, self.testdir)
262261
os.chdir(self.sourcedir)
263-
build.make(self.sourcedir)
264262
build.make(self.sourcedir, extra_args='run_tests')
265263

266264
def cpufreq(self):

0 commit comments

Comments
 (0)