summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/task.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-10-03 09:24:34 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-03 09:26:25 -0700
commite0aaf40e397072eba7944065cf2a820318cb266b (patch)
tree43b3b0eb06369d54f393d5d7704d77efc829eea5 /pkg/sentry/kernel/task.go
parent55f835d1fdd0a5d9dca0b19a65cb748caf326f79 (diff)
Fix kcov enabling and disabling procedures.
- When the KCOV_ENABLE_TRACE ioctl is called with the trace kind KCOV_TRACE_PC, the kcov mode should be set to KCOV_*MODE*_TRACE_PC. - When the owning task of kcov exits, the memory mapping should not be cleared so it can be used by other tasks. - Add more tests (also tested on native Linux kcov). PiperOrigin-RevId: 335202585
Diffstat (limited to 'pkg/sentry/kernel/task.go')
-rw-r--r--pkg/sentry/kernel/task.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/task.go b/pkg/sentry/kernel/task.go
index a436610c9..f796e0fa3 100644
--- a/pkg/sentry/kernel/task.go
+++ b/pkg/sentry/kernel/task.go
@@ -917,7 +917,7 @@ func (t *Task) SetKcov(k *Kcov) {
// ResetKcov clears the kcov instance associated with t.
func (t *Task) ResetKcov() {
if t.kcov != nil {
- t.kcov.Reset()
+ t.kcov.OnTaskExit()
t.kcov = nil
}
}