Fix coverage data collection

http://hydra.nixos.org/build/3253046
wip/yesman
Eelco Dolstra 12 years ago
parent e5d4524dda
commit 1da362b34b
  1. 12
      modules/system/boot/systemd.nix
  2. 11
      modules/system/upstart/upstart.nix
  3. 6
      modules/testing/test-instrumentation.nix

@ -229,7 +229,8 @@ let
[Service]
Environment=PATH=${def.path}
${concatMapStrings (n: "Environment=${n}=${getAttr n def.environment}\n") (attrNames def.environment)}
${let env = cfg.globalEnvironment // def.environment;
in concatMapStrings (n: "Environment=${n}=${getAttr n env}\n") (attrNames env)}
${optionalString (!def.restartIfChanged) "X-RestartIfChanged=false"}
${optionalString (def.preStart != "") ''
@ -391,6 +392,15 @@ in
description = "Default unit started when the system boots.";
};
boot.systemd.globalEnvironment = mkOption {
type = types.attrs;
default = {};
example = { TZ = "CET"; };
description = ''
Environment variables passed to <emphasis>all</emphasis> systemd units.
'';
};
services.journald.console = mkOption {
default = "";
type = types.uniq types.string;

@ -19,7 +19,7 @@ let
let
hasMain = job.script != "" || job.exec != "";
env = config.system.upstartEnvironment // job.environment;
env = job.environment;
preStartScript = makeJobScript "${job.name}-pre-start"
''
@ -270,15 +270,6 @@ in
options = [ jobOptions upstartJob ];
};
system.upstartEnvironment = mkOption {
type = types.attrs;
default = {};
example = { TZ = "CET"; };
description = ''
Environment variables passed to <emphasis>all</emphasis> Upstart jobs.
'';
};
};

@ -55,10 +55,6 @@ let kernel = config.boot.kernelPackages.kernel; in
# Coverage data is written into /tmp/coverage-data.
mkdir -p /tmp/xchg/coverage-data
# Mount debugfs to gain access to the kernel coverage data (if
# available).
mount -t debugfs none /sys/kernel/debug || true
'';
# If the kernel has been built with coverage instrumentation, make
@ -80,7 +76,7 @@ let kernel = config.boot.kernelPackages.kernel; in
networking.defaultGateway = mkOverride 150 "";
networking.nameservers = mkOverride 150 [ ];
system.upstartEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data";
boot.systemd.globalEnvironment.GCOV_PREFIX = "/tmp/xchg/coverage-data";
system.requiredKernelConfig = with config.lib.kernelConfig; [
(isYes "SERIAL_8250_CONSOLE")

Loading…
Cancel
Save