summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-17 01:00:38 +0000
committergVisor bot <gvisor-bot@google.com>2021-04-17 01:00:38 +0000
commitce460ce2f19e4b8c63f846d6258a0948a0766578 (patch)
treee029fa98ad0b419efa5ac5827746e6dc522f463f /runsc/boot
parented4ffd6b8cc12ae502d8077843d53a630f5cf519 (diff)
parent0c3e8daf503e011f0ef3e2a1c6d8b6ffd946acab (diff)
Merge release-20210408.0-46-g0c3e8daf5 (automated)
Diffstat (limited to 'runsc/boot')
-rw-r--r--runsc/boot/loader.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 95daf1f00..5d6e67279 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -29,6 +29,7 @@ import (
"gvisor.dev/gvisor/pkg/abi/linux"
"gvisor.dev/gvisor/pkg/bpf"
"gvisor.dev/gvisor/pkg/context"
+ "gvisor.dev/gvisor/pkg/coverage"
"gvisor.dev/gvisor/pkg/cpuid"
"gvisor.dev/gvisor/pkg/fd"
"gvisor.dev/gvisor/pkg/log"
@@ -1000,6 +1001,13 @@ func (l *Loader) waitContainer(cid string, waitStatus *uint32) error {
// consider the container exited.
ws := l.wait(tg)
*waitStatus = ws
+
+ // Write coverage report after the root container has exited. This guarantees
+ // that the report is written in cases where the sandbox is killed by a signal
+ // after the ContainerWait request is completed.
+ if l.root.procArgs.ContainerID == cid {
+ coverage.Report()
+ }
return nil
}