Skip to content

Commit

Permalink
moved ringbuffer eventHandler stop to the probe
Browse files Browse the repository at this point in the history
removed redundant nil checks
  • Loading branch information
val06 committed Nov 6, 2024
1 parent 7aec75b commit 750171b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion pkg/gpu/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func (c *cudaEventConsumer) Stop() {
if c == nil {
return
}
c.eventHandler.Stop()
c.once.Do(func() {
close(c.closed)
})
Expand Down
16 changes: 4 additions & 12 deletions pkg/gpu/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,19 +163,11 @@ func (p *Probe) start() error {

// Close stops the probe
func (p *Probe) Close() {
if p.procMon != nil {
p.procMon.Stop()
}

if p.attacher != nil {
p.attacher.Stop()
}

p.procMon.Stop()
p.attacher.Stop()
_ = p.m.Stop(manager.CleanAll)

if p.consumer != nil {
p.consumer.Stop()
}
p.consumer.Stop()
p.eventHandler.Stop()
}

// GetAndFlush returns the GPU stats
Expand Down

0 comments on commit 750171b

Please sign in to comment.