-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbpfusdt_x86_bpfel.go
More file actions
184 lines (163 loc) · 4.84 KB
/
bpfusdt_x86_bpfel.go
File metadata and controls
184 lines (163 loc) · 4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Code generated by bpf2go; DO NOT EDIT.
//go:build (386 || amd64) && linux
package usdt
import (
"bytes"
_ "embed"
"fmt"
"io"
"structs"
"github.com/cilium/ebpf"
)
type bpfUsdtBpfUsdtSpec struct {
_ structs.HostLayout
Args [12]struct {
_ structs.HostLayout
ValOff uint64
ArgType uint32
RegId uint8
ArgSigned bool
ArgBitshift int8
ArgIsFloat bool
Pad [1]uint8
_ [7]byte
}
UsdtCookie uint64
ArgCnt int16
Pad [6]uint8
}
// loadBpfUsdt returns the embedded CollectionSpec for bpfUsdt.
func loadBpfUsdt() (*ebpf.CollectionSpec, error) {
reader := bytes.NewReader(_BpfUsdtBytes)
spec, err := ebpf.LoadCollectionSpecFromReader(reader)
if err != nil {
return nil, fmt.Errorf("can't load bpfUsdt: %w", err)
}
return spec, err
}
// loadBpfUsdtObjects loads bpfUsdt and converts it into a struct.
//
// The following types are suitable as obj argument:
//
// *bpfUsdtObjects
// *bpfUsdtPrograms
// *bpfUsdtMaps
//
// See ebpf.CollectionSpec.LoadAndAssign documentation for details.
func loadBpfUsdtObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
spec, err := loadBpfUsdt()
if err != nil {
return err
}
return spec.LoadAndAssign(obj, opts)
}
// bpfUsdtSpecs contains maps and programs before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpfUsdtSpecs struct {
bpfUsdtProgramSpecs
bpfUsdtMapSpecs
bpfUsdtVariableSpecs
}
// bpfUsdtProgramSpecs contains programs before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpfUsdtProgramSpecs struct {
ConstProbe *ebpf.ProgramSpec `ebpf:"const_probe"`
Int32Args *ebpf.ProgramSpec `ebpf:"int32_args"`
Int64Args *ebpf.ProgramSpec `ebpf:"int64_args"`
MemoryProbe *ebpf.ProgramSpec `ebpf:"memory_probe"`
MixedProbe *ebpf.ProgramSpec `ebpf:"mixed_probe"`
MixedRefs *ebpf.ProgramSpec `ebpf:"mixed_refs"`
SimpleProbe *ebpf.ProgramSpec `ebpf:"simple_probe"`
Uint8Args *ebpf.ProgramSpec `ebpf:"uint8_args"`
UsdtDummyProbe *ebpf.ProgramSpec `ebpf:"usdt_dummy_probe"`
UsdtTestMulti *ebpf.ProgramSpec `ebpf:"usdt_test_multi"`
}
// bpfUsdtMapSpecs contains maps before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpfUsdtMapSpecs struct {
BpfUsdtSpecs *ebpf.MapSpec `ebpf:"__bpf_usdt_specs"`
UsdtTestResults *ebpf.MapSpec `ebpf:"usdt_test_results"`
}
// bpfUsdtVariableSpecs contains global variables before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpfUsdtVariableSpecs struct {
WithDebugOutput *ebpf.VariableSpec `ebpf:"with_debug_output"`
}
// bpfUsdtObjects contains all objects after they have been loaded into the kernel.
//
// It can be passed to loadBpfUsdtObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpfUsdtObjects struct {
bpfUsdtPrograms
bpfUsdtMaps
bpfUsdtVariables
}
func (o *bpfUsdtObjects) Close() error {
return _BpfUsdtClose(
&o.bpfUsdtPrograms,
&o.bpfUsdtMaps,
)
}
// bpfUsdtMaps contains all maps after they have been loaded into the kernel.
//
// It can be passed to loadBpfUsdtObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpfUsdtMaps struct {
BpfUsdtSpecs *ebpf.Map `ebpf:"__bpf_usdt_specs"`
UsdtTestResults *ebpf.Map `ebpf:"usdt_test_results"`
}
func (m *bpfUsdtMaps) Close() error {
return _BpfUsdtClose(
m.BpfUsdtSpecs,
m.UsdtTestResults,
)
}
// bpfUsdtVariables contains all global variables after they have been loaded into the kernel.
//
// It can be passed to loadBpfUsdtObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpfUsdtVariables struct {
WithDebugOutput *ebpf.Variable `ebpf:"with_debug_output"`
}
// bpfUsdtPrograms contains all programs after they have been loaded into the kernel.
//
// It can be passed to loadBpfUsdtObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpfUsdtPrograms struct {
ConstProbe *ebpf.Program `ebpf:"const_probe"`
Int32Args *ebpf.Program `ebpf:"int32_args"`
Int64Args *ebpf.Program `ebpf:"int64_args"`
MemoryProbe *ebpf.Program `ebpf:"memory_probe"`
MixedProbe *ebpf.Program `ebpf:"mixed_probe"`
MixedRefs *ebpf.Program `ebpf:"mixed_refs"`
SimpleProbe *ebpf.Program `ebpf:"simple_probe"`
Uint8Args *ebpf.Program `ebpf:"uint8_args"`
UsdtDummyProbe *ebpf.Program `ebpf:"usdt_dummy_probe"`
UsdtTestMulti *ebpf.Program `ebpf:"usdt_test_multi"`
}
func (p *bpfUsdtPrograms) Close() error {
return _BpfUsdtClose(
p.ConstProbe,
p.Int32Args,
p.Int64Args,
p.MemoryProbe,
p.MixedProbe,
p.MixedRefs,
p.SimpleProbe,
p.Uint8Args,
p.UsdtDummyProbe,
p.UsdtTestMulti,
)
}
func _BpfUsdtClose(closers ...io.Closer) error {
for _, closer := range closers {
if err := closer.Close(); err != nil {
return err
}
}
return nil
}
// Do not access this directly.
//
//go:embed bpfusdt_x86_bpfel.o
var _BpfUsdtBytes []byte