* Cleanup the kernel coverage analysis.
svn path=/nixos/trunk/; revision=16919
This commit is contained in:
parent
4d8d704fba
commit
e7acca2ba3
@ -22,6 +22,27 @@ sub startAll {
|
||||
sub runTests {
|
||||
eval "$context $ENV{tests}";
|
||||
die $@ if $@;
|
||||
|
||||
# Copy the kernel coverage data for each machine, if the kernel
|
||||
# has been compiled with coverage instrumentation.
|
||||
foreach my $vm (values %vms) {
|
||||
my ($status, $out) = $vm->execute("test -e /proc/gcov");
|
||||
next if $status != 0;
|
||||
|
||||
# Figure out where to put the *.gcda files so that the report
|
||||
# generator can find the corresponding kernel sources.
|
||||
my $kernelDir = $vm->mustSucceed("echo \$(dirname \$(readlink -f /var/run/current-system/kernel))/.build/linux-*");
|
||||
chomp $kernelDir;
|
||||
my $coverageDir = "/hostfs" . $vm->stateDir() . "/coverage-data/$kernelDir";
|
||||
|
||||
# Copy all the *.gcda files. The ones under
|
||||
# /proc/gcov/module/nix/store are the kernel modules in the
|
||||
# initrd to which we have applied nuke-refs in
|
||||
# makeModuleClosure. This confuses the gcov module a bit.
|
||||
$vm->execute("for i in \$(cd /proc/gcov && find -name module -prune -o -name '*.gcda'); do echo \$i; mkdir -p $coverageDir/\$(dirname \$i); cp -v /proc/gcov/\$i $coverageDir/\$i; done");
|
||||
|
||||
$vm->execute("for i in \$(cd /proc/gcov/module/nix/store/*/.build/* && find -name module -prune -o -name '*.gcda'); do mkdir -p $coverageDir/\$(dirname \$i); cp /proc/gcov/module/nix/store/*/.build/*/\$i $coverageDir/\$i; done");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,6 +31,11 @@ with pkgs.lib;
|
||||
ln -s /hostfs/$hostTmpDir/coverage-data /tmp/coverage-data
|
||||
)
|
||||
'';
|
||||
|
||||
# If the kernel has been built with coverage instrumentation, make
|
||||
# it available under /proc/gcov.
|
||||
boot.kernelModules = [ "gcov-proc" ];
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -51,7 +51,6 @@ rec {
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
boot.kernelModules = [ "gcov-proc" ];
|
||||
services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "e.dolstra@tudelft.nl";
|
||||
services.httpd.extraSubservices =
|
||||
@ -131,13 +130,6 @@ rec {
|
||||
# Stop Apache to gather all the coverage data.
|
||||
$webserver->stopJob("httpd");
|
||||
$webserver->execute("sleep 10"); # !!!
|
||||
|
||||
# !!! move this to build-vms.nix
|
||||
my $kernelDir = $webserver->mustSucceed("echo \$(dirname \$(readlink -f /var/run/current-system/kernel))/.build/linux-*");
|
||||
chomp $kernelDir;
|
||||
my $coverageDir = "/hostfs" . $webserver->stateDir() . "/coverage-data/$kernelDir";
|
||||
$webserver->execute("for i in \$(cd /proc/gcov && find -name module -prune -o -name '*.gcda'); do echo \$i; mkdir -p $coverageDir/\$(dirname \$i); cp -v /proc/gcov/\$i $coverageDir/\$i; done");
|
||||
$webserver->execute("for i in \$(cd /proc/gcov/module/nix/store/*/.build/* && find -name module -prune -o -name '*.gcda'); do mkdir -p $coverageDir/\$(dirname \$i); cp /proc/gcov/module/nix/store/*/.build/*/\$i $coverageDir/\$i; done");
|
||||
'';
|
||||
|
||||
report = makeReport test;
|
||||
|
Loading…
Reference in New Issue
Block a user