137 lines
3.5 KiB
Go
137 lines
3.5 KiB
Go
// Code generated by bpf2go; DO NOT EDIT.
|
|
//go:build (386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64 || wasm) && linux
|
|
|
|
package main
|
|
|
|
import (
|
|
"bytes"
|
|
_ "embed"
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/cilium/ebpf"
|
|
)
|
|
|
|
// loadTracepoint returns the embedded CollectionSpec for tracepoint.
|
|
func loadTracepoint() (*ebpf.CollectionSpec, error) {
|
|
reader := bytes.NewReader(_TracepointBytes)
|
|
spec, err := ebpf.LoadCollectionSpecFromReader(reader)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("can't load tracepoint: %w", err)
|
|
}
|
|
|
|
return spec, err
|
|
}
|
|
|
|
// loadTracepointObjects loads tracepoint and converts it into a struct.
|
|
//
|
|
// The following types are suitable as obj argument:
|
|
//
|
|
// *tracepointObjects
|
|
// *tracepointPrograms
|
|
// *tracepointMaps
|
|
//
|
|
// See ebpf.CollectionSpec.LoadAndAssign documentation for details.
|
|
func loadTracepointObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
|
|
spec, err := loadTracepoint()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return spec.LoadAndAssign(obj, opts)
|
|
}
|
|
|
|
// tracepointSpecs contains maps and programs before they are loaded into the kernel.
|
|
//
|
|
// It can be passed ebpf.CollectionSpec.Assign.
|
|
type tracepointSpecs struct {
|
|
tracepointProgramSpecs
|
|
tracepointMapSpecs
|
|
tracepointVariableSpecs
|
|
}
|
|
|
|
// tracepointProgramSpecs contains programs before they are loaded into the kernel.
|
|
//
|
|
// It can be passed ebpf.CollectionSpec.Assign.
|
|
type tracepointProgramSpecs struct {
|
|
TraceOpenat *ebpf.ProgramSpec `ebpf:"trace_openat"`
|
|
}
|
|
|
|
// tracepointMapSpecs contains maps before they are loaded into the kernel.
|
|
//
|
|
// It can be passed ebpf.CollectionSpec.Assign.
|
|
type tracepointMapSpecs struct {
|
|
Events *ebpf.MapSpec `ebpf:"events"`
|
|
TargetFilenameMap *ebpf.MapSpec `ebpf:"target_filename_map"`
|
|
}
|
|
|
|
// tracepointVariableSpecs contains global variables before they are loaded into the kernel.
|
|
//
|
|
// It can be passed ebpf.CollectionSpec.Assign.
|
|
type tracepointVariableSpecs struct {
|
|
}
|
|
|
|
// tracepointObjects contains all objects after they have been loaded into the kernel.
|
|
//
|
|
// It can be passed to loadTracepointObjects or ebpf.CollectionSpec.LoadAndAssign.
|
|
type tracepointObjects struct {
|
|
tracepointPrograms
|
|
tracepointMaps
|
|
tracepointVariables
|
|
}
|
|
|
|
func (o *tracepointObjects) Close() error {
|
|
return _TracepointClose(
|
|
&o.tracepointPrograms,
|
|
&o.tracepointMaps,
|
|
)
|
|
}
|
|
|
|
// tracepointMaps contains all maps after they have been loaded into the kernel.
|
|
//
|
|
// It can be passed to loadTracepointObjects or ebpf.CollectionSpec.LoadAndAssign.
|
|
type tracepointMaps struct {
|
|
Events *ebpf.Map `ebpf:"events"`
|
|
TargetFilenameMap *ebpf.Map `ebpf:"target_filename_map"`
|
|
}
|
|
|
|
func (m *tracepointMaps) Close() error {
|
|
return _TracepointClose(
|
|
m.Events,
|
|
m.TargetFilenameMap,
|
|
)
|
|
}
|
|
|
|
// tracepointVariables contains all global variables after they have been loaded into the kernel.
|
|
//
|
|
// It can be passed to loadTracepointObjects or ebpf.CollectionSpec.LoadAndAssign.
|
|
type tracepointVariables struct {
|
|
}
|
|
|
|
// tracepointPrograms contains all programs after they have been loaded into the kernel.
|
|
//
|
|
// It can be passed to loadTracepointObjects or ebpf.CollectionSpec.LoadAndAssign.
|
|
type tracepointPrograms struct {
|
|
TraceOpenat *ebpf.Program `ebpf:"trace_openat"`
|
|
}
|
|
|
|
func (p *tracepointPrograms) Close() error {
|
|
return _TracepointClose(
|
|
p.TraceOpenat,
|
|
)
|
|
}
|
|
|
|
func _TracepointClose(closers ...io.Closer) error {
|
|
for _, closer := range closers {
|
|
if err := closer.Close(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Do not access this directly.
|
|
//
|
|
//go:embed tracepoint_bpfel.o
|
|
var _TracepointBytes []byte
|