github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/trace/fsslower/tracer/fsslower_x86_bpfel.go (about) 1 // Code generated by bpf2go; DO NOT EDIT. 2 //go:build 386 || amd64 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 fsslowerEvent struct { 16 DeltaUs uint64 17 EndNs uint64 18 Offset int64 19 Size uint64 20 MntnsId uint64 21 Timestamp uint64 22 Pid uint32 23 Op uint32 24 File [32]uint8 25 Task [16]uint8 26 } 27 28 // loadFsslower returns the embedded CollectionSpec for fsslower. 29 func loadFsslower() (*ebpf.CollectionSpec, error) { 30 reader := bytes.NewReader(_FsslowerBytes) 31 spec, err := ebpf.LoadCollectionSpecFromReader(reader) 32 if err != nil { 33 return nil, fmt.Errorf("can't load fsslower: %w", err) 34 } 35 36 return spec, err 37 } 38 39 // loadFsslowerObjects loads fsslower and converts it into a struct. 40 // 41 // The following types are suitable as obj argument: 42 // 43 // *fsslowerObjects 44 // *fsslowerPrograms 45 // *fsslowerMaps 46 // 47 // See ebpf.CollectionSpec.LoadAndAssign documentation for details. 48 func loadFsslowerObjects(obj interface{}, opts *ebpf.CollectionOptions) error { 49 spec, err := loadFsslower() 50 if err != nil { 51 return err 52 } 53 54 return spec.LoadAndAssign(obj, opts) 55 } 56 57 // fsslowerSpecs contains maps and programs before they are loaded into the kernel. 58 // 59 // It can be passed ebpf.CollectionSpec.Assign. 60 type fsslowerSpecs struct { 61 fsslowerProgramSpecs 62 fsslowerMapSpecs 63 } 64 65 // fsslowerSpecs contains programs before they are loaded into the kernel. 66 // 67 // It can be passed ebpf.CollectionSpec.Assign. 68 type fsslowerProgramSpecs struct { 69 IgFsslOpenE *ebpf.ProgramSpec `ebpf:"ig_fssl_open_e"` 70 IgFsslOpenX *ebpf.ProgramSpec `ebpf:"ig_fssl_open_x"` 71 IgFsslReadE *ebpf.ProgramSpec `ebpf:"ig_fssl_read_e"` 72 IgFsslReadX *ebpf.ProgramSpec `ebpf:"ig_fssl_read_x"` 73 IgFsslStatfsE *ebpf.ProgramSpec `ebpf:"ig_fssl_statfs_e"` 74 IgFsslStatfsX *ebpf.ProgramSpec `ebpf:"ig_fssl_statfs_x"` 75 IgFsslSyncE *ebpf.ProgramSpec `ebpf:"ig_fssl_sync_e"` 76 IgFsslSyncX *ebpf.ProgramSpec `ebpf:"ig_fssl_sync_x"` 77 IgFsslWrE *ebpf.ProgramSpec `ebpf:"ig_fssl_wr_e"` 78 IgFsslWrX *ebpf.ProgramSpec `ebpf:"ig_fssl_wr_x"` 79 } 80 81 // fsslowerMapSpecs contains maps before they are loaded into the kernel. 82 // 83 // It can be passed ebpf.CollectionSpec.Assign. 84 type fsslowerMapSpecs struct { 85 Events *ebpf.MapSpec `ebpf:"events"` 86 GadgetMntnsFilterMap *ebpf.MapSpec `ebpf:"gadget_mntns_filter_map"` 87 Starts *ebpf.MapSpec `ebpf:"starts"` 88 } 89 90 // fsslowerObjects contains all objects after they have been loaded into the kernel. 91 // 92 // It can be passed to loadFsslowerObjects or ebpf.CollectionSpec.LoadAndAssign. 93 type fsslowerObjects struct { 94 fsslowerPrograms 95 fsslowerMaps 96 } 97 98 func (o *fsslowerObjects) Close() error { 99 return _FsslowerClose( 100 &o.fsslowerPrograms, 101 &o.fsslowerMaps, 102 ) 103 } 104 105 // fsslowerMaps contains all maps after they have been loaded into the kernel. 106 // 107 // It can be passed to loadFsslowerObjects or ebpf.CollectionSpec.LoadAndAssign. 108 type fsslowerMaps struct { 109 Events *ebpf.Map `ebpf:"events"` 110 GadgetMntnsFilterMap *ebpf.Map `ebpf:"gadget_mntns_filter_map"` 111 Starts *ebpf.Map `ebpf:"starts"` 112 } 113 114 func (m *fsslowerMaps) Close() error { 115 return _FsslowerClose( 116 m.Events, 117 m.GadgetMntnsFilterMap, 118 m.Starts, 119 ) 120 } 121 122 // fsslowerPrograms contains all programs after they have been loaded into the kernel. 123 // 124 // It can be passed to loadFsslowerObjects or ebpf.CollectionSpec.LoadAndAssign. 125 type fsslowerPrograms struct { 126 IgFsslOpenE *ebpf.Program `ebpf:"ig_fssl_open_e"` 127 IgFsslOpenX *ebpf.Program `ebpf:"ig_fssl_open_x"` 128 IgFsslReadE *ebpf.Program `ebpf:"ig_fssl_read_e"` 129 IgFsslReadX *ebpf.Program `ebpf:"ig_fssl_read_x"` 130 IgFsslStatfsE *ebpf.Program `ebpf:"ig_fssl_statfs_e"` 131 IgFsslStatfsX *ebpf.Program `ebpf:"ig_fssl_statfs_x"` 132 IgFsslSyncE *ebpf.Program `ebpf:"ig_fssl_sync_e"` 133 IgFsslSyncX *ebpf.Program `ebpf:"ig_fssl_sync_x"` 134 IgFsslWrE *ebpf.Program `ebpf:"ig_fssl_wr_e"` 135 IgFsslWrX *ebpf.Program `ebpf:"ig_fssl_wr_x"` 136 } 137 138 func (p *fsslowerPrograms) Close() error { 139 return _FsslowerClose( 140 p.IgFsslOpenE, 141 p.IgFsslOpenX, 142 p.IgFsslReadE, 143 p.IgFsslReadX, 144 p.IgFsslStatfsE, 145 p.IgFsslStatfsX, 146 p.IgFsslSyncE, 147 p.IgFsslSyncX, 148 p.IgFsslWrE, 149 p.IgFsslWrX, 150 ) 151 } 152 153 func _FsslowerClose(closers ...io.Closer) error { 154 for _, closer := range closers { 155 if err := closer.Close(); err != nil { 156 return err 157 } 158 } 159 return nil 160 } 161 162 // Do not access this directly. 163 // 164 //go:embed fsslower_x86_bpfel.o 165 var _FsslowerBytes []byte