github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/profile/tcprtt/tracer/tcprtt_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 tcpRTTHist struct {
    16  	Latency uint64
    17  	Cnt     uint64
    18  	Slots   [27]uint32
    19  	_       [4]byte
    20  }
    21  
    22  type tcpRTTHistKey struct {
    23  	Family uint16
    24  	Addr   [16]uint8
    25  }
    26  
    27  // loadTcpRTT returns the embedded CollectionSpec for tcpRTT.
    28  func loadTcpRTT() (*ebpf.CollectionSpec, error) {
    29  	reader := bytes.NewReader(_TcpRTTBytes)
    30  	spec, err := ebpf.LoadCollectionSpecFromReader(reader)
    31  	if err != nil {
    32  		return nil, fmt.Errorf("can't load tcpRTT: %w", err)
    33  	}
    34  
    35  	return spec, err
    36  }
    37  
    38  // loadTcpRTTObjects loads tcpRTT and converts it into a struct.
    39  //
    40  // The following types are suitable as obj argument:
    41  //
    42  //	*tcpRTTObjects
    43  //	*tcpRTTPrograms
    44  //	*tcpRTTMaps
    45  //
    46  // See ebpf.CollectionSpec.LoadAndAssign documentation for details.
    47  func loadTcpRTTObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
    48  	spec, err := loadTcpRTT()
    49  	if err != nil {
    50  		return err
    51  	}
    52  
    53  	return spec.LoadAndAssign(obj, opts)
    54  }
    55  
    56  // tcpRTTSpecs contains maps and programs before they are loaded into the kernel.
    57  //
    58  // It can be passed ebpf.CollectionSpec.Assign.
    59  type tcpRTTSpecs struct {
    60  	tcpRTTProgramSpecs
    61  	tcpRTTMapSpecs
    62  }
    63  
    64  // tcpRTTSpecs contains programs before they are loaded into the kernel.
    65  //
    66  // It can be passed ebpf.CollectionSpec.Assign.
    67  type tcpRTTProgramSpecs struct {
    68  	IgTcprcvestKp *ebpf.ProgramSpec `ebpf:"ig_tcprcvest_kp"`
    69  }
    70  
    71  // tcpRTTMapSpecs contains maps before they are loaded into the kernel.
    72  //
    73  // It can be passed ebpf.CollectionSpec.Assign.
    74  type tcpRTTMapSpecs struct {
    75  	Hists *ebpf.MapSpec `ebpf:"hists"`
    76  }
    77  
    78  // tcpRTTObjects contains all objects after they have been loaded into the kernel.
    79  //
    80  // It can be passed to loadTcpRTTObjects or ebpf.CollectionSpec.LoadAndAssign.
    81  type tcpRTTObjects struct {
    82  	tcpRTTPrograms
    83  	tcpRTTMaps
    84  }
    85  
    86  func (o *tcpRTTObjects) Close() error {
    87  	return _TcpRTTClose(
    88  		&o.tcpRTTPrograms,
    89  		&o.tcpRTTMaps,
    90  	)
    91  }
    92  
    93  // tcpRTTMaps contains all maps after they have been loaded into the kernel.
    94  //
    95  // It can be passed to loadTcpRTTObjects or ebpf.CollectionSpec.LoadAndAssign.
    96  type tcpRTTMaps struct {
    97  	Hists *ebpf.Map `ebpf:"hists"`
    98  }
    99  
   100  func (m *tcpRTTMaps) Close() error {
   101  	return _TcpRTTClose(
   102  		m.Hists,
   103  	)
   104  }
   105  
   106  // tcpRTTPrograms contains all programs after they have been loaded into the kernel.
   107  //
   108  // It can be passed to loadTcpRTTObjects or ebpf.CollectionSpec.LoadAndAssign.
   109  type tcpRTTPrograms struct {
   110  	IgTcprcvestKp *ebpf.Program `ebpf:"ig_tcprcvest_kp"`
   111  }
   112  
   113  func (p *tcpRTTPrograms) Close() error {
   114  	return _TcpRTTClose(
   115  		p.IgTcprcvestKp,
   116  	)
   117  }
   118  
   119  func _TcpRTTClose(closers ...io.Closer) error {
   120  	for _, closer := range closers {
   121  		if err := closer.Close(); err != nil {
   122  			return err
   123  		}
   124  	}
   125  	return nil
   126  }
   127  
   128  // Do not access this directly.
   129  //
   130  //go:embed tcprtt_arm64_bpfel.o
   131  var _TcpRTTBytes []byte