diff --git a/ci/2_pull_source.sh b/ci/2_pull_source.sh index fb605ad..0367076 100755 --- a/ci/2_pull_source.sh +++ b/ci/2_pull_source.sh @@ -3,19 +3,14 @@ cd $MCDC_HOME # This meta repository -git clone https://github.com/xlab-uiuc/linux-mcdc.git --branch llvm19 +git clone https://github.com/xlab-uiuc/linux-mcdc.git --branch v0.6-wip # LLVM if we want to build it from source (optional) -git clone https://github.com/llvm/llvm-project.git --branch main +git clone https://github.com/llvm/llvm-project.git --depth 5 # Linux kernel git clone https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git --branch v5.15.153 --depth 5 -# Use the snapshot of LLVM on June 11 2024 -cd $MCDC_HOME/llvm-project -git checkout f5dcfb9968a3 - # Apply kernel patches cd $MCDC_HOME/linux -git apply $MCDC_HOME/linux-mcdc/patches/v0.5/0001-clang_instr_profile-add-Clang-s-Source-based-Code-Co.patch -git apply $MCDC_HOME/linux-mcdc/patches/v0.5/0002-kbuild-clang_instr_profile-disable-instrumentation-i.patch -git apply $MCDC_HOME/linux-mcdc/patches/v0.5/0003-clang_instr_profile-add-Clang-s-MC-DC-support.patch -git apply $MCDC_HOME/linux-mcdc/patches/v0.5/0004-kbuild-clang_instr_profile-disable-instrumentation-i.patch +git apply $MCDC_HOME/linux-mcdc/patches/v0.6-wip/0001-llvm-cov-add-Clang-s-Source-based-Code-Coverage-supp.patch +git apply $MCDC_HOME/linux-mcdc/patches/v0.6-wip/0002-kbuild-llvm-cov-disable-instrumentation-in-odd-or-se.patch +git apply $MCDC_HOME/linux-mcdc/patches/v0.6-wip/0003-llvm-cov-add-Clang-s-MC-DC-support.patch diff --git a/ci/4_build_kernel.sh b/ci/4_build_kernel.sh index 544b9f4..10c946f 100755 --- a/ci/4_build_kernel.sh +++ b/ci/4_build_kernel.sh @@ -19,9 +19,9 @@ make LLVM=1 olddefconfig ./scripts/config -e CONFIG_KUNIT_ALL_TESTS make LLVM=1 olddefconfig -./scripts/config -e CONFIG_INSTR_PROFILE_CLANG -./scripts/config -e CONFIG_SCC_CLANG -./scripts/config -e CONFIG_MCDC_CLANG +./scripts/config -e CONFIG_LLVM_COV_KERNEL +./scripts/config -e CONFIG_LLVM_COV_KERNEL_MCDC +./scripts/config --set-val LLVM_COV_KERNEL_MCDC_MAX_CONDITIONS 44 make LLVM=1 olddefconfig cat << EOF diff --git a/ci/5_boot_kernel_and_collect_coverage.sh b/ci/5_boot_kernel_and_collect_coverage.sh index 18c4312..a43cf7c 100755 --- a/ci/5_boot_kernel_and_collect_coverage.sh +++ b/ci/5_boot_kernel_and_collect_coverage.sh @@ -2,8 +2,8 @@ GUEST_COMMANDS="true" GUEST_COMMANDS="$GUEST_COMMANDS; uname -a" -GUEST_COMMANDS="$GUEST_COMMANDS; ls /sys/kernel/debug/clang_instr_profile" -GUEST_COMMANDS="$GUEST_COMMANDS; cp /sys/kernel/debug/clang_instr_profile/profraw ." +GUEST_COMMANDS="$GUEST_COMMANDS; ls /sys/kernel/debug/llvm-cov" +GUEST_COMMANDS="$GUEST_COMMANDS; cp /sys/kernel/debug/llvm-cov/profraw ." cd $MCDC_HOME/linux $MCDC_HOME/linux-mcdc/scripts/q -c "$GUEST_COMMANDS"