vendor: update github.com/weaveworks/tcptracer-bpf

This commit is contained in:
Michael Schubert
2017-03-22 10:07:55 +01:00
parent cd25b8b935
commit b49d2e6f9d
3 changed files with 20 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@@ -13,6 +13,7 @@ type Tracer struct {
m *bpflib.Module
perfMapIPV4 *bpflib.PerfMap
perfMapIPV6 *bpflib.PerfMap
stopChan chan struct{}
}
func TracerAsset() ([]byte, error) {
@@ -61,17 +62,27 @@ func NewTracer(tcpEventCbV4 func(TcpV4), tcpEventCbV6 func(TcpV6)) (*Tracer, err
perfMapIPV4.SetTimestampFunc(tcpV4Timestamp)
perfMapIPV6.SetTimestampFunc(tcpV6Timestamp)
stopChan := make(chan struct{})
go func() {
for {
data := <-channelV4
tcpEventCbV4(tcpV4ToGo(&data))
select {
case <-stopChan:
return
case data := <-channelV4:
tcpEventCbV4(tcpV4ToGo(&data))
}
}
}()
go func() {
for {
data := <-channelV6
tcpEventCbV6(tcpV6ToGo(&data))
select {
case <-stopChan:
return
case data := <-channelV6:
tcpEventCbV6(tcpV6ToGo(&data))
}
}
}()
@@ -82,10 +93,12 @@ func NewTracer(tcpEventCbV4 func(TcpV4), tcpEventCbV6 func(TcpV6)) (*Tracer, err
m: m,
perfMapIPV4: perfMapIPV4,
perfMapIPV6: perfMapIPV6,
stopChan: stopChan,
}, nil
}
func (t *Tracer) Stop() {
close(t.stopChan)
t.perfMapIPV4.PollStop()
t.perfMapIPV6.PollStop()
}

2
vendor/manifest vendored
View File

@@ -1454,7 +1454,7 @@
"importpath": "github.com/weaveworks/tcptracer-bpf",
"repository": "https://github.com/weaveworks/tcptracer-bpf",
"vcs": "git",
"revision": "9065e4672b606b5f8d2f2d664938641fa0ee0d0f",
"revision": "d4a42f2cc89eb19e60113f7e35945a29b97c695f",
"branch": "master",
"notests": true
},