Created
August 8, 2017 15:46
-
-
Save alban/cb4b899e9558e231d080ec7e7b3abbc5 to your computer and use it in GitHub Desktop.
gobpf.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/vendor/github.com/weaveworks/tcptracer-bpf/pkg/tracer/tracer.go b/vendor/github.com/weaveworks/tcptracer-bpf/pkg/tracer/tracer.go | |
index 8d725a3..90e32c3 100644 | |
--- a/vendor/github.com/weaveworks/tcptracer-bpf/pkg/tracer/tracer.go | |
+++ b/vendor/github.com/weaveworks/tcptracer-bpf/pkg/tracer/tracer.go | |
@@ -15,6 +15,10 @@ type Tracer struct { | |
perfMapIPV4 *bpflib.PerfMap | |
perfMapIPV6 *bpflib.PerfMap | |
stopChan chan struct{} | |
+ channelV4 chan []byte | |
+ channelV6 chan []byte | |
+ lostChanV4 chan uint64 | |
+ lostChanV6 chan uint64 | |
} | |
// maxActive configures the maximum number of instances of the probed functions | |
@@ -106,6 +110,10 @@ func NewTracer(cb Callback) (*Tracer, error) { | |
perfMapIPV4: perfMapIPV4, | |
perfMapIPV6: perfMapIPV6, | |
stopChan: stopChan, | |
+ channelV4: channelV4, | |
+ channelV6: channelV6, | |
+ lostChanV4: lostChanV4, | |
+ lostChanV6: lostChanV6, | |
}, nil | |
} | |
@@ -129,8 +137,15 @@ func (t *Tracer) RemoveFdInstallWatcher(pid uint32) (err error) { | |
func (t *Tracer) Stop() { | |
close(t.stopChan) | |
+ | |
t.perfMapIPV4.PollStop() | |
+ close(t.channelV4) | |
+ close(t.lostChanV4) | |
+ | |
t.perfMapIPV6.PollStop() | |
+ close(t.channelV6) | |
+ close(t.lostChanV6) | |
+ | |
t.m.Close() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment