github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/trace/exec/tracer/execsnoopwithlongpaths_bpfel.go (about)

     1  // Code generated by bpf2go; DO NOT EDIT.
     2  //go:build 386 || amd64 || arm || arm64 || loong64 || mips64le || mipsle || ppc64le || riscv64
     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 execsnoopWithLongPathsBufT struct{ Buf [32768]uint8 }
    16  
    17  type execsnoopWithLongPathsEvent struct {
    18  	MntnsId    uint64
    19  	Timestamp  uint64
    20  	Pid        uint32
    21  	Ppid       uint32
    22  	Uid        uint32
    23  	Gid        uint32
    24  	Loginuid   uint32
    25  	Sessionid  uint32
    26  	Retval     int32
    27  	ArgsCount  int32
    28  	UpperLayer bool
    29  	_          [3]byte
    30  	ArgsSize   uint32
    31  	Comm       [16]uint8
    32  	Pcomm      [16]uint8
    33  	Cwd        [4096]uint8
    34  	Exepath    [4096]uint8
    35  	Args       [7680]uint8
    36  }
    37  
    38  // loadExecsnoopWithLongPaths returns the embedded CollectionSpec for execsnoopWithLongPaths.
    39  func loadExecsnoopWithLongPaths() (*ebpf.CollectionSpec, error) {
    40  	reader := bytes.NewReader(_ExecsnoopWithLongPathsBytes)
    41  	spec, err := ebpf.LoadCollectionSpecFromReader(reader)
    42  	if err != nil {
    43  		return nil, fmt.Errorf("can't load execsnoopWithLongPaths: %w", err)
    44  	}
    45  
    46  	return spec, err
    47  }
    48  
    49  // loadExecsnoopWithLongPathsObjects loads execsnoopWithLongPaths and converts it into a struct.
    50  //
    51  // The following types are suitable as obj argument:
    52  //
    53  //	*execsnoopWithLongPathsObjects
    54  //	*execsnoopWithLongPathsPrograms
    55  //	*execsnoopWithLongPathsMaps
    56  //
    57  // See ebpf.CollectionSpec.LoadAndAssign documentation for details.
    58  func loadExecsnoopWithLongPathsObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
    59  	spec, err := loadExecsnoopWithLongPaths()
    60  	if err != nil {
    61  		return err
    62  	}
    63  
    64  	return spec.LoadAndAssign(obj, opts)
    65  }
    66  
    67  // execsnoopWithLongPathsSpecs contains maps and programs before they are loaded into the kernel.
    68  //
    69  // It can be passed ebpf.CollectionSpec.Assign.
    70  type execsnoopWithLongPathsSpecs struct {
    71  	execsnoopWithLongPathsProgramSpecs
    72  	execsnoopWithLongPathsMapSpecs
    73  }
    74  
    75  // execsnoopWithLongPathsSpecs contains programs before they are loaded into the kernel.
    76  //
    77  // It can be passed ebpf.CollectionSpec.Assign.
    78  type execsnoopWithLongPathsProgramSpecs struct {
    79  	IgExecveE *ebpf.ProgramSpec `ebpf:"ig_execve_e"`
    80  	IgExecveX *ebpf.ProgramSpec `ebpf:"ig_execve_x"`
    81  }
    82  
    83  // execsnoopWithLongPathsMapSpecs contains maps before they are loaded into the kernel.
    84  //
    85  // It can be passed ebpf.CollectionSpec.Assign.
    86  type execsnoopWithLongPathsMapSpecs struct {
    87  	Bufs                 *ebpf.MapSpec `ebpf:"bufs"`
    88  	Events               *ebpf.MapSpec `ebpf:"events"`
    89  	Execs                *ebpf.MapSpec `ebpf:"execs"`
    90  	GadgetMntnsFilterMap *ebpf.MapSpec `ebpf:"gadget_mntns_filter_map"`
    91  	PidByTgid            *ebpf.MapSpec `ebpf:"pid_by_tgid"`
    92  }
    93  
    94  // execsnoopWithLongPathsObjects contains all objects after they have been loaded into the kernel.
    95  //
    96  // It can be passed to loadExecsnoopWithLongPathsObjects or ebpf.CollectionSpec.LoadAndAssign.
    97  type execsnoopWithLongPathsObjects struct {
    98  	execsnoopWithLongPathsPrograms
    99  	execsnoopWithLongPathsMaps
   100  }
   101  
   102  func (o *execsnoopWithLongPathsObjects) Close() error {
   103  	return _ExecsnoopWithLongPathsClose(
   104  		&o.execsnoopWithLongPathsPrograms,
   105  		&o.execsnoopWithLongPathsMaps,
   106  	)
   107  }
   108  
   109  // execsnoopWithLongPathsMaps contains all maps after they have been loaded into the kernel.
   110  //
   111  // It can be passed to loadExecsnoopWithLongPathsObjects or ebpf.CollectionSpec.LoadAndAssign.
   112  type execsnoopWithLongPathsMaps struct {
   113  	Bufs                 *ebpf.Map `ebpf:"bufs"`
   114  	Events               *ebpf.Map `ebpf:"events"`
   115  	Execs                *ebpf.Map `ebpf:"execs"`
   116  	GadgetMntnsFilterMap *ebpf.Map `ebpf:"gadget_mntns_filter_map"`
   117  	PidByTgid            *ebpf.Map `ebpf:"pid_by_tgid"`
   118  }
   119  
   120  func (m *execsnoopWithLongPathsMaps) Close() error {
   121  	return _ExecsnoopWithLongPathsClose(
   122  		m.Bufs,
   123  		m.Events,
   124  		m.Execs,
   125  		m.GadgetMntnsFilterMap,
   126  		m.PidByTgid,
   127  	)
   128  }
   129  
   130  // execsnoopWithLongPathsPrograms contains all programs after they have been loaded into the kernel.
   131  //
   132  // It can be passed to loadExecsnoopWithLongPathsObjects or ebpf.CollectionSpec.LoadAndAssign.
   133  type execsnoopWithLongPathsPrograms struct {
   134  	IgExecveE *ebpf.Program `ebpf:"ig_execve_e"`
   135  	IgExecveX *ebpf.Program `ebpf:"ig_execve_x"`
   136  }
   137  
   138  func (p *execsnoopWithLongPathsPrograms) Close() error {
   139  	return _ExecsnoopWithLongPathsClose(
   140  		p.IgExecveE,
   141  		p.IgExecveX,
   142  	)
   143  }
   144  
   145  func _ExecsnoopWithLongPathsClose(closers ...io.Closer) error {
   146  	for _, closer := range closers {
   147  		if err := closer.Close(); err != nil {
   148  			return err
   149  		}
   150  	}
   151  	return nil
   152  }
   153  
   154  // Do not access this directly.
   155  //
   156  //go:embed execsnoopwithlongpaths_bpfel.o
   157  var _ExecsnoopWithLongPathsBytes []byte