Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump tcptracer-bpf version #2705

Merged
merged 1 commit into from
Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions probe/endpoint/ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func newEbpfTracker() (*EbpfTracker, error) {
openConnections: map[fourTuple]ebpfConnection{},
}

tracer, err := tracer.NewTracer(tracker.tcpEventCbV4, tracker.tcpEventCbV6, tracker.lostCb)
tracer, err := tracer.NewTracer(tracker)
if err != nil {
return nil, err
}
Expand All @@ -91,7 +91,8 @@ func newEbpfTracker() (*EbpfTracker, error) {
return tracker, nil
}

func (t *EbpfTracker) tcpEventCbV4(e tracer.TcpV4) {
// TCPEventV4 handles IPv4 TCP events from the eBPF tracer
func (t *EbpfTracker) TCPEventV4(e tracer.TcpV4) {
if t.lastTimestampV4 > e.Timestamp {
// A kernel bug can cause the timestamps to be wrong (e.g. on Ubuntu with Linux 4.4.0-47.68)
// Upgrading the kernel will fix the problem. For further info see:
Expand All @@ -111,15 +112,24 @@ func (t *EbpfTracker) tcpEventCbV4(e tracer.TcpV4) {
}
}

func (t *EbpfTracker) tcpEventCbV6(e tracer.TcpV6) {
// TCPEventV6 handles IPv6 TCP events from the eBPF tracer. This is
// currently a no-op.
func (t *EbpfTracker) TCPEventV6(e tracer.TcpV6) {
// TODO: IPv6 not supported in Scope
}

func (t *EbpfTracker) lostCb(count uint64) {
// LostV4 handles IPv4 TCP event misses from the eBPF tracer.
func (t *EbpfTracker) LostV4(count uint64) {
log.Errorf("tcp tracer lost %d events. Stopping the eBPF tracker", count)
t.stop()
}

// LostV6 handles IPv4 TCP event misses from the eBPF tracer. This is
// currently a no-op.
func (t *EbpfTracker) LostV6(count uint64) {
// TODO: IPv6 not supported in Scope
}

func tupleFromPidFd(pid int, fd int) (tuple fourTuple, netns string, ok bool) {
// read /proc/$pid/ns/net
//
Expand Down
6 changes: 3 additions & 3 deletions probe/endpoint/ebpf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ func TestInvalidTimeStampDead(t *testing.T) {
openConnections: map[fourTuple]ebpfConnection{},
}
event.Timestamp = 0
mockEbpfTracker.tcpEventCbV4(event)
mockEbpfTracker.TCPEventV4(event)
event2 := event
event2.SPort = 1
event2.Timestamp = 2
mockEbpfTracker.tcpEventCbV4(event2)
mockEbpfTracker.TCPEventV4(event2)
mockEbpfTracker.walkConnections(func(e ebpfConnection) {
cnt++
})
Expand All @@ -226,7 +226,7 @@ func TestInvalidTimeStampDead(t *testing.T) {
}
cnt = 0
event.Timestamp = 1
mockEbpfTracker.tcpEventCbV4(event)
mockEbpfTracker.TCPEventV4(event)
mockEbpfTracker.walkConnections(func(e ebpfConnection) {
cnt++
})
Expand Down
14 changes: 0 additions & 14 deletions vendor/github.com/iovisor/gobpf/bpffs/COPYRIGHT.txt

This file was deleted.

201 changes: 0 additions & 201 deletions vendor/github.com/iovisor/gobpf/bpffs/LICENSE.txt

This file was deleted.

14 changes: 0 additions & 14 deletions vendor/github.com/iovisor/gobpf/elf/COPYRIGHT.txt

This file was deleted.

Loading