diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-25 23:32:40 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-25 23:32:40 +0000 |
commit | 8dc17db3592306d63285c1bbb29a4f65770ead68 (patch) | |
tree | 3c9de07f545c554b25a296f3f00563fcaab358e3 /pkg/sentry/kernel/task.go | |
parent | 1aac5deacbe63987087b1aa82a1c604eb0c9e932 (diff) | |
parent | cb573c8e0bf042ea111dc83c72f25d135623032f (diff) |
Merge release-20200818.0-54-gcb573c8e0 (automated)
Diffstat (limited to 'pkg/sentry/kernel/task.go')
-rw-r--r-- | pkg/sentry/kernel/task.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/task.go b/pkg/sentry/kernel/task.go index 5aee699e7..a436610c9 100644 --- a/pkg/sentry/kernel/task.go +++ b/pkg/sentry/kernel/task.go @@ -574,6 +574,11 @@ type Task struct { // // startTime is protected by mu. startTime ktime.Time + + // kcov is the kcov instance providing code coverage owned by this task. + // + // kcov is exclusive to the task goroutine. + kcov *Kcov } func (t *Task) savePtraceTracer() *Task { @@ -903,3 +908,16 @@ func (t *Task) UID() uint32 { func (t *Task) GID() uint32 { return uint32(t.Credentials().EffectiveKGID) } + +// SetKcov sets the kcov instance associated with t. +func (t *Task) SetKcov(k *Kcov) { + t.kcov = k +} + +// ResetKcov clears the kcov instance associated with t. +func (t *Task) ResetKcov() { + if t.kcov != nil { + t.kcov.Reset() + t.kcov = nil + } +} |