Skip to content

Commit f92a50b

Browse files
committed
kernelci.build: Add a kselftest-slim fragment
The kselftest fragment is a constant source of problems booting boards since it ends up being very much larger than standard configurations which cause lots of problems for u-boot boards, limiting our ability to run the selftests and creating constant overhead. This mainly comes from the cpufreq and LKDTM fragments, they turn on some options which instrument the entire kernel which adds overhead everywhere. Add a new special Kconfig fragment type kselftest-slim which merges all fragments other than those two. For x86_64 defconfig this produces a substantial improvement in image size, bloat-o-meter reports: Total: Before=38073475, After=24629302, chg -35.31% for kselftest and kselftest-slim. If other fragments start causing similar issues we can add them to the list filtered out by kselftest-slim. Signed-off-by: Mark Brown <[email protected]>
1 parent 6d988f0 commit f92a50b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

kernelci/build.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,12 @@ def make_tarball(kdir, tarball_name):
241241
os.chdir(cwd)
242242

243243

244-
def generate_kselftest_fragment(frag, kdir):
244+
def generate_kselftest_fragment(frag, kdir, skip=[]):
245245
"""Create a config fragment file for kselftest
246246
247247
*frag* is a Fragment object
248248
*kdir* is the path to a kernel source directory
249+
*skip* is a list of kselftests to skip
249250
"""
250251
shell_cmd(r"""
251252
set -e
@@ -259,6 +260,8 @@ def generate_kselftest_fragment(frag, kdir):
259260
""".format(kdir=kdir, frag_path=frag.path))
260261
with open(os.path.join(kdir, frag.path), 'a') as f:
261262
for kernel_config in frag.configs:
263+
if kernel_config in enumerate(skip):
264+
continue
262265
f.write(kernel_config + '\n')
263266

264267

@@ -273,6 +276,12 @@ def generate_config_fragment(frag, kdir):
273276
f.write(kernel_config + '\n')
274277

275278

279+
slim_skip_frags = [
280+
"tools/testing/selftests/lkdtm/config",
281+
"tools/testing/selftests/cpufreq/config"
282+
]
283+
284+
276285
def generate_fragments(config, kdir):
277286
"""Generate all the config fragments for a given build configuration
278287
@@ -288,6 +297,8 @@ def generate_fragments(config, kdir):
288297
print(frag.path)
289298
if frag.name == 'kselftest':
290299
generate_kselftest_fragment(frag, kdir)
300+
elif frag.name == 'kselftest-slim':
301+
generate_kselftest_fragment(frag, kdir, skip=slim_skip_frags)
291302
elif frag.configs:
292303
generate_config_fragment(frag, kdir)
293304

0 commit comments

Comments
 (0)