Skip to content

Commit

Permalink
Merge pull request #59 from DataDog/bryce.kahle/fix-tracefs-cleanup-self
Browse files Browse the repository at this point in the history
Ensure we do not attempt to cleanup probes from ourself
  • Loading branch information
brycekahle committed Nov 11, 2021
2 parents 95ceaf8 + be9a5c8 commit 3709b75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ func (m *Manager) UpdateActivatedProbes(selectors []ProbesSelector) error {
}
}

for id, _ := range nextProbes {
for id := range nextProbes {
if _, alreadyPresent := currentProbes[id]; alreadyPresent {
delete(currentProbes, id)
} else {
Expand Down Expand Up @@ -1524,7 +1524,7 @@ func (m *Manager) cleanupTracefs() error {

// clean up kprobe_events
var cleanUpErrors *multierror.Error
pidMask := make(map[int]procMask)
pidMask := map[int]procMask{os.Getpid(): Running}
cleanUpErrors = multierror.Append(cleanUpErrors, cleanupKprobeEvents(pattern, pidMask))
cleanUpErrors = multierror.Append(cleanUpErrors, cleanupUprobeEvents(pattern, pidMask))
if cleanUpErrors.Len() == 0 {
Expand Down

0 comments on commit 3709b75

Please sign in to comment.