github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/top/ebpf/piditer/piditer_arm64_bpfel.go (about)

     1  // Code generated by bpf2go; DO NOT EDIT.
     2  //go:build arm64
     3  
     4  package piditer
     5  
     6  import (
     7  	"bytes"
     8  	_ "embed"
     9  	"fmt"
    10  	"io"
    11  
    12  	"github.com/cilium/ebpf"
    13  )
    14  
    15  type piditerPidIterEntry struct {
    16  	Id   uint32
    17  	Pid  uint32
    18  	Comm [16]uint8
    19  }
    20  
    21  // loadPiditer returns the embedded CollectionSpec for piditer.
    22  func loadPiditer() (*ebpf.CollectionSpec, error) {
    23  	reader := bytes.NewReader(_PiditerBytes)
    24  	spec, err := ebpf.LoadCollectionSpecFromReader(reader)
    25  	if err != nil {
    26  		return nil, fmt.Errorf("can't load piditer: %w", err)
    27  	}
    28  
    29  	return spec, err
    30  }
    31  
    32  // loadPiditerObjects loads piditer and converts it into a struct.
    33  //
    34  // The following types are suitable as obj argument:
    35  //
    36  //	*piditerObjects
    37  //	*piditerPrograms
    38  //	*piditerMaps
    39  //
    40  // See ebpf.CollectionSpec.LoadAndAssign documentation for details.
    41  func loadPiditerObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
    42  	spec, err := loadPiditer()
    43  	if err != nil {
    44  		return err
    45  	}
    46  
    47  	return spec.LoadAndAssign(obj, opts)
    48  }
    49  
    50  // piditerSpecs contains maps and programs before they are loaded into the kernel.
    51  //
    52  // It can be passed ebpf.CollectionSpec.Assign.
    53  type piditerSpecs struct {
    54  	piditerProgramSpecs
    55  	piditerMapSpecs
    56  }
    57  
    58  // piditerSpecs contains programs before they are loaded into the kernel.
    59  //
    60  // It can be passed ebpf.CollectionSpec.Assign.
    61  type piditerProgramSpecs struct {
    62  	IgTopEbpfIt *ebpf.ProgramSpec `ebpf:"ig_top_ebpf_it"`
    63  }
    64  
    65  // piditerMapSpecs contains maps before they are loaded into the kernel.
    66  //
    67  // It can be passed ebpf.CollectionSpec.Assign.
    68  type piditerMapSpecs struct {
    69  }
    70  
    71  // piditerObjects contains all objects after they have been loaded into the kernel.
    72  //
    73  // It can be passed to loadPiditerObjects or ebpf.CollectionSpec.LoadAndAssign.
    74  type piditerObjects struct {
    75  	piditerPrograms
    76  	piditerMaps
    77  }
    78  
    79  func (o *piditerObjects) Close() error {
    80  	return _PiditerClose(
    81  		&o.piditerPrograms,
    82  		&o.piditerMaps,
    83  	)
    84  }
    85  
    86  // piditerMaps contains all maps after they have been loaded into the kernel.
    87  //
    88  // It can be passed to loadPiditerObjects or ebpf.CollectionSpec.LoadAndAssign.
    89  type piditerMaps struct {
    90  }
    91  
    92  func (m *piditerMaps) Close() error {
    93  	return _PiditerClose()
    94  }
    95  
    96  // piditerPrograms contains all programs after they have been loaded into the kernel.
    97  //
    98  // It can be passed to loadPiditerObjects or ebpf.CollectionSpec.LoadAndAssign.
    99  type piditerPrograms struct {
   100  	IgTopEbpfIt *ebpf.Program `ebpf:"ig_top_ebpf_it"`
   101  }
   102  
   103  func (p *piditerPrograms) Close() error {
   104  	return _PiditerClose(
   105  		p.IgTopEbpfIt,
   106  	)
   107  }
   108  
   109  func _PiditerClose(closers ...io.Closer) error {
   110  	for _, closer := range closers {
   111  		if err := closer.Close(); err != nil {
   112  			return err
   113  		}
   114  	}
   115  	return nil
   116  }
   117  
   118  // Do not access this directly.
   119  //
   120  //go:embed piditer_arm64_bpfel.o
   121  var _PiditerBytes []byte