mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 04:54:27 +01:00
fix parsec, kernel rebuild only if config change
This commit is contained in:
@@ -203,17 +203,20 @@ def main(args, extra_args=None):
|
|||||||
# CLI kernel configurations.
|
# CLI kernel configurations.
|
||||||
kernel_config_fragment_cli_path = os.path.join(common.buildroot_build_dir, 'lkmc_kernel_config_fragment_cli')
|
kernel_config_fragment_cli_path = os.path.join(common.buildroot_build_dir, 'lkmc_kernel_config_fragment_cli')
|
||||||
kernel_config_cli_str = '\n'.join(args.kernel_config)
|
kernel_config_cli_str = '\n'.join(args.kernel_config)
|
||||||
|
do_write = False
|
||||||
if os.path.exists(kernel_config_fragment_cli_path):
|
if os.path.exists(kernel_config_fragment_cli_path):
|
||||||
with open(kernel_config_fragment_cli_path, 'r') as kernel_config_fragment_cli_file:
|
with open(kernel_config_fragment_cli_path, 'r') as kernel_config_fragment_cli_file:
|
||||||
kernel_config_cli_str_old = kernel_config_fragment_cli_file.read()
|
kernel_config_cli_str_old = kernel_config_fragment_cli_file.read()
|
||||||
if kernel_config_cli_str != kernel_config_cli_str_old:
|
if kernel_config_cli_str != kernel_config_cli_str_old:
|
||||||
# Only update if modified, otherwise Buildroot rebuilds the
|
|
||||||
# kernel always rebuilds kernel every time.
|
|
||||||
do_write = True
|
do_write = True
|
||||||
else:
|
else:
|
||||||
do_write = True
|
do_write = True
|
||||||
with open(kernel_config_fragment_cli_path, 'w') as kernel_config_fragment_cli_file:
|
if do_write:
|
||||||
kernel_config_fragment_cli_file.write(kernel_config_cli_str)
|
# Only update if modified, otherwise Buildroot tries to
|
||||||
|
# rebuilds the kernel every time, which takes a few seconds.
|
||||||
|
# even when the kernel has already been built.
|
||||||
|
with open(kernel_config_fragment_cli_path, 'w') as kernel_config_fragment_cli_file:
|
||||||
|
kernel_config_fragment_cli_file.write(kernel_config_cli_str)
|
||||||
kernel_config_fragments.append(os.path.join(kernel_config_fragment_cli_path))
|
kernel_config_fragments.append(os.path.join(kernel_config_fragment_cli_path))
|
||||||
if True:
|
if True:
|
||||||
# Kernel configuration fragments.
|
# Kernel configuration fragments.
|
||||||
@@ -269,7 +272,8 @@ def main(args, extra_args=None):
|
|||||||
assert common.run_cmd(
|
assert common.run_cmd(
|
||||||
[
|
[
|
||||||
'make',
|
'make',
|
||||||
'GEM5_LKMC_SRCDIR="{}"'.format(common.gem5_src_dir),
|
'LKMC_GEM5_SRCDIR="{}"'.format(common.gem5_src_dir),
|
||||||
|
'LKMC_PARSEC_BENCHMARK_SRCDIR="{}"'.format(common.parsec_benchmark_src_dir),
|
||||||
'O={}'.format(common.buildroot_build_dir),
|
'O={}'.format(common.buildroot_build_dir),
|
||||||
'V={}'.format(int(args.verbose)),
|
'V={}'.format(int(args.verbose)),
|
||||||
] +
|
] +
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ buildroot_src_dir = os.path.join(submodules_dir, 'buildroot')
|
|||||||
gem5_default_src_dir = os.path.join(submodules_dir, 'gem5')
|
gem5_default_src_dir = os.path.join(submodules_dir, 'gem5')
|
||||||
linux_src_dir = os.path.join(submodules_dir, 'linux')
|
linux_src_dir = os.path.join(submodules_dir, 'linux')
|
||||||
qemu_src_dir = os.path.join(submodules_dir, 'qemu')
|
qemu_src_dir = os.path.join(submodules_dir, 'qemu')
|
||||||
parsec_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
|
parsec_benchmark_src_dir = os.path.join(submodules_dir, 'parsec-benchmark')
|
||||||
|
|
||||||
# Other default variables.
|
# Other default variables.
|
||||||
arch_map = {
|
arch_map = {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
GEM5_VERSION = 1.0
|
GEM5_VERSION = 1.0
|
||||||
GEM5_SITE = $(GEM5_LKMC_SRCDIR)
|
GEM5_SITE = $(LKMC_GEM5_SRCDIR)
|
||||||
GEM5_SITE_METHOD = local
|
GEM5_SITE_METHOD = local
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
ifeq ($(ARCH),x86_64)
|
||||||
|
|||||||
@@ -4,15 +4,20 @@
|
|||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
PARSEC_BENCHMARK_VERSION = master
|
# If we ever upstream to Buildroot.
|
||||||
PARSEC_BENCHMARK_SITE = git@github.com:cirosantilli/parsec-benchmark.git
|
# PARSEC_BENCHMARK_VERSION = 75d55ac446a43c47efb1044844a108c6c330184c
|
||||||
PARSEC_BENCHMARK_SITE_METHOD = git
|
# PARSEC_BENCHMARK_SITE = git@github.com:cirosantilli/parsec-benchmark.git
|
||||||
|
# PARSEC_BENCHMARK_SITE_METHOD = git
|
||||||
|
|
||||||
|
PARSEC_BENCHMARK_VERSION = 1.0
|
||||||
|
PARSEC_BENCHMARK_SITE = $(LKMC_PARSEC_BENCHMARK_SRCDIR)
|
||||||
|
PARSEC_BENCHMARK_SITE_METHOD = local
|
||||||
|
|
||||||
define PARSEC_BENCHMARK_BUILD_CMDS
|
define PARSEC_BENCHMARK_BUILD_CMDS
|
||||||
# TODO make this nicer, only untar when extract step is done.
|
# TODO make this nicer, only untar when extract step is done.
|
||||||
# EXTRACT_CMDS and EXTRA_DOWNLOADS would be good candidates,
|
# EXTRACT_CMDS and EXTRA_DOWNLOADS would be good candidates,
|
||||||
# but they don't run with OVERRIDE_SRCDIR.
|
# but they don't run with OVERRIDE_SRCDIR.
|
||||||
'$(PARSEC_BENCHMARK_PKGDIR)/parsec-benchmark/get-inputs' $(if $(filter $(V),1),-v,) '$(DL_DIR)' '$(@D)/'
|
'$(@D)/get-inputs' $(if $(filter $(V),1),-v,) '$(DL_DIR)' '$(@D)/'
|
||||||
# We run the benchmarks with the wrong arch here to generate the inputs on the host.
|
# We run the benchmarks with the wrong arch here to generate the inputs on the host.
|
||||||
# This is because on gem5 this takes too long to do.
|
# This is because on gem5 this takes too long to do.
|
||||||
export GNU_TARGET_NAME='$(GNU_TARGET_NAME)' && \
|
export GNU_TARGET_NAME='$(GNU_TARGET_NAME)' && \
|
||||||
|
|||||||
Reference in New Issue
Block a user