Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions nixos/lib/test-driver/Machine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,16 @@ sub systemctl {
return $self->execute("systemctl $q");
}

sub systemdAnalyzeBlame {
my ($self) = @_;
my ($status, $lines) = $self->execute("systemd-analyze blame");
return undef if $status != 0;
foreach my $line (split /\n/ ,$lines) {
$line =~ s/\s*//;
$self->log($line);
}
}

# Fail if the given systemd unit is not in the "active" state.
sub requireActiveUnit {
my ($self, $unit) = @_;
Expand Down
7 changes: 7 additions & 0 deletions nixos/lib/test-driver/test-driver.pl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ sub runTests {
$term->WriteHistory;
}

$log->nest("collecting systemd units exection time", sub {
foreach my $vm (values %vms) {
next unless $vm->isUp();
$vm->systemdAnalyzeBlame();
}
});

# Copy the kernel coverage data for each machine, if the kernel
# has been compiled with coverage instrumentation.
$log->nest("collecting coverage data", sub {
Expand Down