vendor: bump runc to 1.0.1
The commands used were (roughly): hack/pin-dependency.sh github.com/opencontainers/runc v1.0.1 hack/lint-dependencies.sh # Follow its recommendations. hack/pin-dependency.sh github.com/cilium/ebpf v0.6.2 hack/pin-dependency.sh github.com/opencontainers/selinux v1.8.2 hack/pin-dependency.sh github.com/sirupsen/logrus v1.8.1 # Recheck. hack/lint-dependencies.sh GO111MODULE=on go mod edit -dropreplace github.com/willf/bitset hack/update-vendor.sh # Recheck. hack/lint-dependencies.sh hack/update-internal-modules.sh # Recheck. hack/lint-dependencies.sh Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
43
vendor/github.com/cilium/ebpf/link/iter.go
generated
vendored
43
vendor/github.com/cilium/ebpf/link/iter.go
generated
vendored
@@ -3,8 +3,10 @@ package link
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"unsafe"
|
||||
|
||||
"github.com/cilium/ebpf"
|
||||
"github.com/cilium/ebpf/internal"
|
||||
)
|
||||
|
||||
type IterOptions struct {
|
||||
@@ -15,19 +17,45 @@ type IterOptions struct {
|
||||
// AttachTo requires the kernel to include BTF of itself,
|
||||
// and it to be compiled with a recent pahole (>= 1.16).
|
||||
Program *ebpf.Program
|
||||
|
||||
// Map specifies the target map for bpf_map_elem and sockmap iterators.
|
||||
// It may be nil.
|
||||
Map *ebpf.Map
|
||||
}
|
||||
|
||||
// AttachIter attaches a BPF seq_file iterator.
|
||||
func AttachIter(opts IterOptions) (*Iter, error) {
|
||||
link, err := AttachRawLink(RawLinkOptions{
|
||||
Program: opts.Program,
|
||||
Attach: ebpf.AttachTraceIter,
|
||||
})
|
||||
if err := haveBPFLink(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
progFd := opts.Program.FD()
|
||||
if progFd < 0 {
|
||||
return nil, fmt.Errorf("invalid program: %s", internal.ErrClosedFd)
|
||||
}
|
||||
|
||||
var info bpfIterLinkInfoMap
|
||||
if opts.Map != nil {
|
||||
mapFd := opts.Map.FD()
|
||||
if mapFd < 0 {
|
||||
return nil, fmt.Errorf("invalid map: %w", internal.ErrClosedFd)
|
||||
}
|
||||
info.map_fd = uint32(mapFd)
|
||||
}
|
||||
|
||||
attr := bpfLinkCreateIterAttr{
|
||||
prog_fd: uint32(progFd),
|
||||
attach_type: ebpf.AttachTraceIter,
|
||||
iter_info: internal.NewPointer(unsafe.Pointer(&info)),
|
||||
iter_info_len: uint32(unsafe.Sizeof(info)),
|
||||
}
|
||||
|
||||
fd, err := bpfLinkCreateIter(&attr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("can't link iterator: %w", err)
|
||||
}
|
||||
|
||||
return &Iter{*link}, err
|
||||
return &Iter{RawLink{fd, ""}}, err
|
||||
}
|
||||
|
||||
// LoadPinnedIter loads a pinned iterator from a bpffs.
|
||||
@@ -65,3 +93,8 @@ func (it *Iter) Open() (io.ReadCloser, error) {
|
||||
|
||||
return fd.File("bpf_iter"), nil
|
||||
}
|
||||
|
||||
// union bpf_iter_link_info.map
|
||||
type bpfIterLinkInfoMap struct {
|
||||
map_fd uint32
|
||||
}
|
||||
|
Reference in New Issue
Block a user