diff --git a/.github/workflows/llvm-trunk.yml b/.github/workflows/llvm-trunk.yml index 3265c57..78ed6e8 100644 --- a/.github/workflows/llvm-trunk.yml +++ b/.github/workflows/llvm-trunk.yml @@ -139,9 +139,7 @@ jobs: llc --version - name: Boot the kernel and collect coverage run: ./ci/5_boot_kernel_and_collect_coverage.sh - - name: Print the index of coverage report (immediately after counter reset) - run: cat $MCDC_HOME/analysis_cnts_reset/text-coverage-reports/index.txt - - name: Print the index of coverage report (immediately after bitmap reset) - run: cat $MCDC_HOME/analysis_bits_reset/text-coverage-reports/index.txt + - name: Print the index of coverage report (immediately after reset) + run: cat $MCDC_HOME/analysis_reset/text-coverage-reports/index.txt - name: Print the index of coverage report run: cat $MCDC_HOME/analysis/text-coverage-reports/index.txt diff --git a/ci/5_boot_kernel_and_collect_coverage.sh b/ci/5_boot_kernel_and_collect_coverage.sh index 6145e01..39192ef 100755 --- a/ci/5_boot_kernel_and_collect_coverage.sh +++ b/ci/5_boot_kernel_and_collect_coverage.sh @@ -1,13 +1,13 @@ #!/bin/bash # -# Test the functionality of cnts_reset +# Test the functionality of reset # GUEST_COMMANDS="true" GUEST_COMMANDS="$GUEST_COMMANDS; uname -a" GUEST_COMMANDS="$GUEST_COMMANDS; ls /sys/kernel/debug/llvm-cov" -GUEST_COMMANDS="$GUEST_COMMANDS; echo 1 > /sys/kernel/debug/llvm-cov/cnts_reset" +GUEST_COMMANDS="$GUEST_COMMANDS; echo 1 > /sys/kernel/debug/llvm-cov/reset" GUEST_COMMANDS="$GUEST_COMMANDS; cp /sys/kernel/debug/llvm-cov/profraw ." cd $MCDC_HOME/linux @@ -19,44 +19,9 @@ if ! grep "LLVM raw profile data, version 10" /tmp/file.log > /dev/null; then exit 1 fi -mkdir -p $MCDC_HOME/analysis_cnts_reset -mv profraw $MCDC_HOME/analysis_cnts_reset -cd $MCDC_HOME/analysis_cnts_reset - -llvm-profdata merge profraw -o profdata -llvm-cov show --show-mcdc \ - --show-mcdc-summary \ - --show-region-summary=false \ - --show-branch-summary=false \ - --format=text \ - -use-color \ - -show-directory-coverage \ - -output-dir=text-coverage-reports \ - -instr-profile profdata \ - $MCDC_HOME/linux/vmlinux - -# -# Test the functionality of bits_reset -# - -GUEST_COMMANDS="true" -GUEST_COMMANDS="$GUEST_COMMANDS; uname -a" -GUEST_COMMANDS="$GUEST_COMMANDS; ls /sys/kernel/debug/llvm-cov" -GUEST_COMMANDS="$GUEST_COMMANDS; echo 1 > /sys/kernel/debug/llvm-cov/bits_reset" -GUEST_COMMANDS="$GUEST_COMMANDS; cp /sys/kernel/debug/llvm-cov/profraw ." - -cd $MCDC_HOME/linux -$MCDC_HOME/linux-mcdc/scripts/q -c "$GUEST_COMMANDS" - -file profraw |& tee /tmp/file.log -if ! grep "LLVM raw profile data, version 10" /tmp/file.log > /dev/null; then - printf "\nUnexpected profraw\n" - exit 1 -fi - -mkdir -p $MCDC_HOME/analysis_bits_reset -mv profraw $MCDC_HOME/analysis_bits_reset -cd $MCDC_HOME/analysis_bits_reset +mkdir -p $MCDC_HOME/analysis_reset +mv profraw $MCDC_HOME/analysis_reset +cd $MCDC_HOME/analysis_reset llvm-profdata merge profraw -o profdata llvm-cov show --show-mcdc \ diff --git a/docs/measure-kernel-mcdc.md b/docs/measure-kernel-mcdc.md index 29222c4..6bb4f72 100644 --- a/docs/measure-kernel-mcdc.md +++ b/docs/measure-kernel-mcdc.md @@ -301,10 +301,9 @@ Let's inspect the directory added to debugfs by our patch: ls /sys/kernel/debug/llvm-cov ``` -which should contain three pseudo files: `profraw`, `cnts_reset` and `bits_reset`. +which should contain two pseudo files: `profraw` and `reset`. -- Writing to `cnts_reset` will clear the in-memory counters -- Writing to `bits_reset` will clear the in-memory bitmaps +- Writing to `reset` will clear the in-memory counters and bitmaps. - Reading `profraw` will serialize the in-memory counters and bitmaps in a [proper format](https://llvm.org/docs/InstrProfileFormat.html)