github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/traceloop/tracer/traceloop_arm64_bpfel.go (about)

     1  // Code generated by bpf2go; DO NOT EDIT.
     2  //go:build arm64
     3  
     4  package tracer
     5  
     6  import (
     7  	"bytes"
     8  	_ "embed"
     9  	"fmt"
    10  	"io"
    11  
    12  	"github.com/cilium/ebpf"
    13  )
    14  
    15  type traceloopSyscallEventContT struct {
    16  	Param              [128]uint8
    17  	MonotonicTimestamp uint64
    18  	Length             uint64
    19  	Index              uint8
    20  	Failed             uint8
    21  	_                  [6]byte
    22  }
    23  
    24  type traceloopSyscallEventT struct {
    25  	Args               [6]uint64
    26  	MonotonicTimestamp uint64
    27  	BootTimestamp      uint64
    28  	Pid                uint32
    29  	Cpu                uint16
    30  	Id                 uint16
    31  	Comm               [16]uint8
    32  	ContNr             uint8
    33  	Typ                uint8
    34  	_                  [6]byte
    35  }
    36  
    37  // loadTraceloop returns the embedded CollectionSpec for traceloop.
    38  func loadTraceloop() (*ebpf.CollectionSpec, error) {
    39  	reader := bytes.NewReader(_TraceloopBytes)
    40  	spec, err := ebpf.LoadCollectionSpecFromReader(reader)
    41  	if err != nil {
    42  		return nil, fmt.Errorf("can't load traceloop: %w", err)
    43  	}
    44  
    45  	return spec, err
    46  }
    47  
    48  // loadTraceloopObjects loads traceloop and converts it into a struct.
    49  //
    50  // The following types are suitable as obj argument:
    51  //
    52  //	*traceloopObjects
    53  //	*traceloopPrograms
    54  //	*traceloopMaps
    55  //
    56  // See ebpf.CollectionSpec.LoadAndAssign documentation for details.
    57  func loadTraceloopObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
    58  	spec, err := loadTraceloop()
    59  	if err != nil {
    60  		return err
    61  	}
    62  
    63  	return spec.LoadAndAssign(obj, opts)
    64  }
    65  
    66  // traceloopSpecs contains maps and programs before they are loaded into the kernel.
    67  //
    68  // It can be passed ebpf.CollectionSpec.Assign.
    69  type traceloopSpecs struct {
    70  	traceloopProgramSpecs
    71  	traceloopMapSpecs
    72  }
    73  
    74  // traceloopSpecs contains programs before they are loaded into the kernel.
    75  //
    76  // It can be passed ebpf.CollectionSpec.Assign.
    77  type traceloopProgramSpecs struct {
    78  	IgTraceloopE *ebpf.ProgramSpec `ebpf:"ig_traceloop_e"`
    79  	IgTraceloopX *ebpf.ProgramSpec `ebpf:"ig_traceloop_x"`
    80  }
    81  
    82  // traceloopMapSpecs contains maps before they are loaded into the kernel.
    83  //
    84  // It can be passed ebpf.CollectionSpec.Assign.
    85  type traceloopMapSpecs struct {
    86  	GadgetMntnsFilterMap *ebpf.MapSpec `ebpf:"gadget_mntns_filter_map"`
    87  	MapOfPerfBuffers     *ebpf.MapSpec `ebpf:"map_of_perf_buffers"`
    88  	ProbeAtSysExit       *ebpf.MapSpec `ebpf:"probe_at_sys_exit"`
    89  	RegsMap              *ebpf.MapSpec `ebpf:"regs_map"`
    90  	SyscallFilters       *ebpf.MapSpec `ebpf:"syscall_filters"`
    91  	Syscalls             *ebpf.MapSpec `ebpf:"syscalls"`
    92  }
    93  
    94  // traceloopObjects contains all objects after they have been loaded into the kernel.
    95  //
    96  // It can be passed to loadTraceloopObjects or ebpf.CollectionSpec.LoadAndAssign.
    97  type traceloopObjects struct {
    98  	traceloopPrograms
    99  	traceloopMaps
   100  }
   101  
   102  func (o *traceloopObjects) Close() error {
   103  	return _TraceloopClose(
   104  		&o.traceloopPrograms,
   105  		&o.traceloopMaps,
   106  	)
   107  }
   108  
   109  // traceloopMaps contains all maps after they have been loaded into the kernel.
   110  //
   111  // It can be passed to loadTraceloopObjects or ebpf.CollectionSpec.LoadAndAssign.
   112  type traceloopMaps struct {
   113  	GadgetMntnsFilterMap *ebpf.Map `ebpf:"gadget_mntns_filter_map"`
   114  	MapOfPerfBuffers     *ebpf.Map `ebpf:"map_of_perf_buffers"`
   115  	ProbeAtSysExit       *ebpf.Map `ebpf:"probe_at_sys_exit"`
   116  	RegsMap              *ebpf.Map `ebpf:"regs_map"`
   117  	SyscallFilters       *ebpf.Map `ebpf:"syscall_filters"`
   118  	Syscalls             *ebpf.Map `ebpf:"syscalls"`
   119  }
   120  
   121  func (m *traceloopMaps) Close() error {
   122  	return _TraceloopClose(
   123  		m.GadgetMntnsFilterMap,
   124  		m.MapOfPerfBuffers,
   125  		m.ProbeAtSysExit,
   126  		m.RegsMap,
   127  		m.SyscallFilters,
   128  		m.Syscalls,
   129  	)
   130  }
   131  
   132  // traceloopPrograms contains all programs after they have been loaded into the kernel.
   133  //
   134  // It can be passed to loadTraceloopObjects or ebpf.CollectionSpec.LoadAndAssign.
   135  type traceloopPrograms struct {
   136  	IgTraceloopE *ebpf.Program `ebpf:"ig_traceloop_e"`
   137  	IgTraceloopX *ebpf.Program `ebpf:"ig_traceloop_x"`
   138  }
   139  
   140  func (p *traceloopPrograms) Close() error {
   141  	return _TraceloopClose(
   142  		p.IgTraceloopE,
   143  		p.IgTraceloopX,
   144  	)
   145  }
   146  
   147  func _TraceloopClose(closers ...io.Closer) error {
   148  	for _, closer := range closers {
   149  		if err := closer.Close(); err != nil {
   150  			return err
   151  		}
   152  	}
   153  	return nil
   154  }
   155  
   156  // Do not access this directly.
   157  //
   158  //go:embed traceloop_arm64_bpfel.o
   159  var _TraceloopBytes []byte