Skip to content

Commit

Permalink
service/debugger: Remove target lock on GetBufferedTracepoints (go-de…
Browse files Browse the repository at this point in the history
…lve#2645)

There is already a lock on the actual buffered tracepoints collection
within proc, and this method call doesn't do anything to mutate Target
otherwise so we shouldn't be opening ourselves up for a race condition
error or any other kind of parallelism problem.

Additionally, with this lock we essentially can never get the data until
the process has exited becuase `continue` will lock the target. This
change allows us to get the buffered tracepoint information immediately
and display it as the program is running.
  • Loading branch information
derekparker authored Aug 5, 2021
1 parent 2971fd4 commit 7caa534
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions service/debugger/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2124,9 +2124,6 @@ func (d *Debugger) Target() *proc.Target {
}

func (d *Debugger) GetBufferedTracepoints() []api.TracepointResult {
d.targetMutex.Lock()
defer d.targetMutex.Unlock()

traces := d.target.GetBufferedTracepoints()
if traces == nil {
return nil
Expand Down

0 comments on commit 7caa534

Please sign in to comment.