fix parsec, kernel rebuild only if config change

This commit is contained in:
Ciro Santilli
2018-09-13 09:50:03 +01:00
parent 71c2b44c46
commit e4861f2f89
4 changed files with 20 additions and 11 deletions

View File

@@ -203,17 +203,20 @@ def main(args, extra_args=None):
# CLI kernel configurations.
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)
do_write = False
if os.path.exists(kernel_config_fragment_cli_path):
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()
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
else:
do_write = True
with open(kernel_config_fragment_cli_path, 'w') as kernel_config_fragment_cli_file:
kernel_config_fragment_cli_file.write(kernel_config_cli_str)
if do_write:
# 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))
if True:
# Kernel configuration fragments.
@@ -269,7 +272,8 @@ def main(args, extra_args=None):
assert common.run_cmd(
[
'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),
'V={}'.format(int(args.verbose)),
] +

View File

@@ -29,7 +29,7 @@ buildroot_src_dir = os.path.join(submodules_dir, 'buildroot')
gem5_default_src_dir = os.path.join(submodules_dir, 'gem5')
linux_src_dir = os.path.join(submodules_dir, 'linux')
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.
arch_map = {

View File

@@ -5,7 +5,7 @@
################################################################################
GEM5_VERSION = 1.0
GEM5_SITE = $(GEM5_LKMC_SRCDIR)
GEM5_SITE = $(LKMC_GEM5_SRCDIR)
GEM5_SITE_METHOD = local
ifeq ($(ARCH),x86_64)

View File

@@ -4,15 +4,20 @@
#
################################################################################
PARSEC_BENCHMARK_VERSION = master
PARSEC_BENCHMARK_SITE = git@github.com:cirosantilli/parsec-benchmark.git
PARSEC_BENCHMARK_SITE_METHOD = git
# If we ever upstream to Buildroot.
# PARSEC_BENCHMARK_VERSION = 75d55ac446a43c47efb1044844a108c6c330184c
# 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
# TODO make this nicer, only untar when extract step is done.
# EXTRACT_CMDS and EXTRA_DOWNLOADS would be good candidates,
# 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.
# This is because on gem5 this takes too long to do.
export GNU_TARGET_NAME='$(GNU_TARGET_NAME)' && \