-
Notifications
You must be signed in to change notification settings - Fork 78
/
bpf_debug_bpfel_x86.go
362 lines (331 loc) · 10.6 KB
/
bpf_debug_bpfel_x86.go
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
// Code generated by bpf2go; DO NOT EDIT.
//go:build 386 || amd64
package httpfltr
import (
"bytes"
_ "embed"
"fmt"
"io"
"github.com/cilium/ebpf"
)
type bpf_debugConnectionInfoT struct {
S_addr [16]uint8
D_addr [16]uint8
S_port uint16
D_port uint16
}
type bpf_debugHttp2ConnStreamT struct {
PidConn bpf_debugPidConnectionInfoT
StreamId uint32
}
type bpf_debugHttp2GrpcRequestT struct {
Flags uint8
_ [1]byte
ConnInfo bpf_debugConnectionInfoT
Data [256]uint8
RetData [64]uint8
Type uint8
_ [1]byte
Len int32
_ [4]byte
StartMonotimeNs uint64
EndMonotimeNs uint64
Pid struct {
HostPid uint32
UserPid uint32
Ns uint32
}
_ [4]byte
Tp struct {
TraceId [16]uint8
SpanId [8]uint8
ParentId [8]uint8
Ts uint64
Flags uint8
_ [7]byte
}
}
type bpf_debugHttpConnectionMetadataT struct {
Pid struct {
HostPid uint32
UserPid uint32
Ns uint32
}
Type uint8
}
type bpf_debugHttpInfoT struct {
Flags uint8
_ [1]byte
ConnInfo bpf_debugConnectionInfoT
_ [2]byte
StartMonotimeNs uint64
EndMonotimeNs uint64
Buf [160]uint8
Len uint32
RespLen uint32
Status uint16
Type uint8
Ssl uint8
Pid struct {
HostPid uint32
UserPid uint32
Ns uint32
}
Tp struct {
TraceId [16]uint8
SpanId [8]uint8
ParentId [8]uint8
Ts uint64
Flags uint8
_ [7]byte
}
}
type bpf_debugPartialConnectionInfoT struct {
S_addr [16]uint8
S_port uint16
D_port uint16
TcpSeq uint32
}
type bpf_debugPidConnectionInfoT struct {
Conn bpf_debugConnectionInfoT
Pid uint32
}
type bpf_debugPidKeyT struct {
Pid uint32
Ns uint32
}
type bpf_debugRecvArgsT struct {
SockPtr uint64
IovecPtr uint64
}
type bpf_debugSendArgsT struct {
P_conn bpf_debugPidConnectionInfoT
Size uint64
}
type bpf_debugSockArgsT struct {
Addr uint64
AcceptTime uint64
}
type bpf_debugSslArgsT struct {
Ssl uint64
Buf uint64
LenPtr uint64
}
type bpf_debugTpInfoPidT struct {
Tp struct {
TraceId [16]uint8
SpanId [8]uint8
ParentId [8]uint8
Ts uint64
Flags uint8
_ [7]byte
}
Pid uint32
Valid uint8
_ [3]byte
}
// loadBpf_debug returns the embedded CollectionSpec for bpf_debug.
func loadBpf_debug() (*ebpf.CollectionSpec, error) {
reader := bytes.NewReader(_Bpf_debugBytes)
spec, err := ebpf.LoadCollectionSpecFromReader(reader)
if err != nil {
return nil, fmt.Errorf("can't load bpf_debug: %w", err)
}
return spec, err
}
// loadBpf_debugObjects loads bpf_debug and converts it into a struct.
//
// The following types are suitable as obj argument:
//
// *bpf_debugObjects
// *bpf_debugPrograms
// *bpf_debugMaps
//
// See ebpf.CollectionSpec.LoadAndAssign documentation for details.
func loadBpf_debugObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
spec, err := loadBpf_debug()
if err != nil {
return err
}
return spec.LoadAndAssign(obj, opts)
}
// bpf_debugSpecs contains maps and programs before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_debugSpecs struct {
bpf_debugProgramSpecs
bpf_debugMapSpecs
}
// bpf_debugSpecs contains programs before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_debugProgramSpecs struct {
KprobeSysExit *ebpf.ProgramSpec `ebpf:"kprobe_sys_exit"`
KprobeTcpClose *ebpf.ProgramSpec `ebpf:"kprobe_tcp_close"`
KprobeTcpConnect *ebpf.ProgramSpec `ebpf:"kprobe_tcp_connect"`
KprobeTcpRcvEstablished *ebpf.ProgramSpec `ebpf:"kprobe_tcp_rcv_established"`
KprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_recvmsg"`
KprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kprobe_tcp_sendmsg"`
KretprobeSockAlloc *ebpf.ProgramSpec `ebpf:"kretprobe_sock_alloc"`
KretprobeSysAccept4 *ebpf.ProgramSpec `ebpf:"kretprobe_sys_accept4"`
KretprobeSysClone *ebpf.ProgramSpec `ebpf:"kretprobe_sys_clone"`
KretprobeSysConnect *ebpf.ProgramSpec `ebpf:"kretprobe_sys_connect"`
KretprobeTcpRecvmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_recvmsg"`
KretprobeTcpSendmsg *ebpf.ProgramSpec `ebpf:"kretprobe_tcp_sendmsg"`
SocketHttpFilter *ebpf.ProgramSpec `ebpf:"socket__http_filter"`
}
// bpf_debugMapSpecs contains maps before they are loaded into the kernel.
//
// It can be passed ebpf.CollectionSpec.Assign.
type bpf_debugMapSpecs struct {
ActiveAcceptArgs *ebpf.MapSpec `ebpf:"active_accept_args"`
ActiveConnectArgs *ebpf.MapSpec `ebpf:"active_connect_args"`
ActiveRecvArgs *ebpf.MapSpec `ebpf:"active_recv_args"`
ActiveSendArgs *ebpf.MapSpec `ebpf:"active_send_args"`
ActiveSendSockArgs *ebpf.MapSpec `ebpf:"active_send_sock_args"`
ActiveSslHandshakes *ebpf.MapSpec `ebpf:"active_ssl_handshakes"`
ActiveSslReadArgs *ebpf.MapSpec `ebpf:"active_ssl_read_args"`
ActiveSslWriteArgs *ebpf.MapSpec `ebpf:"active_ssl_write_args"`
CloneMap *ebpf.MapSpec `ebpf:"clone_map"`
Events *ebpf.MapSpec `ebpf:"events"`
FilteredConnections *ebpf.MapSpec `ebpf:"filtered_connections"`
Http2InfoMem *ebpf.MapSpec `ebpf:"http2_info_mem"`
HttpInfoMem *ebpf.MapSpec `ebpf:"http_info_mem"`
OngoingHttp *ebpf.MapSpec `ebpf:"ongoing_http"`
OngoingHttp2Connections *ebpf.MapSpec `ebpf:"ongoing_http2_connections"`
OngoingHttp2Grpc *ebpf.MapSpec `ebpf:"ongoing_http2_grpc"`
OngoingHttpFallback *ebpf.MapSpec `ebpf:"ongoing_http_fallback"`
PidCache *ebpf.MapSpec `ebpf:"pid_cache"`
PidTidToConn *ebpf.MapSpec `ebpf:"pid_tid_to_conn"`
ServerTraces *ebpf.MapSpec `ebpf:"server_traces"`
SslToConn *ebpf.MapSpec `ebpf:"ssl_to_conn"`
SslToPidTid *ebpf.MapSpec `ebpf:"ssl_to_pid_tid"`
TcpConnectionMap *ebpf.MapSpec `ebpf:"tcp_connection_map"`
TpCharBufMem *ebpf.MapSpec `ebpf:"tp_char_buf_mem"`
TpInfoMem *ebpf.MapSpec `ebpf:"tp_info_mem"`
TraceMap *ebpf.MapSpec `ebpf:"trace_map"`
ValidPids *ebpf.MapSpec `ebpf:"valid_pids"`
}
// bpf_debugObjects contains all objects after they have been loaded into the kernel.
//
// It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_debugObjects struct {
bpf_debugPrograms
bpf_debugMaps
}
func (o *bpf_debugObjects) Close() error {
return _Bpf_debugClose(
&o.bpf_debugPrograms,
&o.bpf_debugMaps,
)
}
// bpf_debugMaps contains all maps after they have been loaded into the kernel.
//
// It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_debugMaps struct {
ActiveAcceptArgs *ebpf.Map `ebpf:"active_accept_args"`
ActiveConnectArgs *ebpf.Map `ebpf:"active_connect_args"`
ActiveRecvArgs *ebpf.Map `ebpf:"active_recv_args"`
ActiveSendArgs *ebpf.Map `ebpf:"active_send_args"`
ActiveSendSockArgs *ebpf.Map `ebpf:"active_send_sock_args"`
ActiveSslHandshakes *ebpf.Map `ebpf:"active_ssl_handshakes"`
ActiveSslReadArgs *ebpf.Map `ebpf:"active_ssl_read_args"`
ActiveSslWriteArgs *ebpf.Map `ebpf:"active_ssl_write_args"`
CloneMap *ebpf.Map `ebpf:"clone_map"`
Events *ebpf.Map `ebpf:"events"`
FilteredConnections *ebpf.Map `ebpf:"filtered_connections"`
Http2InfoMem *ebpf.Map `ebpf:"http2_info_mem"`
HttpInfoMem *ebpf.Map `ebpf:"http_info_mem"`
OngoingHttp *ebpf.Map `ebpf:"ongoing_http"`
OngoingHttp2Connections *ebpf.Map `ebpf:"ongoing_http2_connections"`
OngoingHttp2Grpc *ebpf.Map `ebpf:"ongoing_http2_grpc"`
OngoingHttpFallback *ebpf.Map `ebpf:"ongoing_http_fallback"`
PidCache *ebpf.Map `ebpf:"pid_cache"`
PidTidToConn *ebpf.Map `ebpf:"pid_tid_to_conn"`
ServerTraces *ebpf.Map `ebpf:"server_traces"`
SslToConn *ebpf.Map `ebpf:"ssl_to_conn"`
SslToPidTid *ebpf.Map `ebpf:"ssl_to_pid_tid"`
TcpConnectionMap *ebpf.Map `ebpf:"tcp_connection_map"`
TpCharBufMem *ebpf.Map `ebpf:"tp_char_buf_mem"`
TpInfoMem *ebpf.Map `ebpf:"tp_info_mem"`
TraceMap *ebpf.Map `ebpf:"trace_map"`
ValidPids *ebpf.Map `ebpf:"valid_pids"`
}
func (m *bpf_debugMaps) Close() error {
return _Bpf_debugClose(
m.ActiveAcceptArgs,
m.ActiveConnectArgs,
m.ActiveRecvArgs,
m.ActiveSendArgs,
m.ActiveSendSockArgs,
m.ActiveSslHandshakes,
m.ActiveSslReadArgs,
m.ActiveSslWriteArgs,
m.CloneMap,
m.Events,
m.FilteredConnections,
m.Http2InfoMem,
m.HttpInfoMem,
m.OngoingHttp,
m.OngoingHttp2Connections,
m.OngoingHttp2Grpc,
m.OngoingHttpFallback,
m.PidCache,
m.PidTidToConn,
m.ServerTraces,
m.SslToConn,
m.SslToPidTid,
m.TcpConnectionMap,
m.TpCharBufMem,
m.TpInfoMem,
m.TraceMap,
m.ValidPids,
)
}
// bpf_debugPrograms contains all programs after they have been loaded into the kernel.
//
// It can be passed to loadBpf_debugObjects or ebpf.CollectionSpec.LoadAndAssign.
type bpf_debugPrograms struct {
KprobeSysExit *ebpf.Program `ebpf:"kprobe_sys_exit"`
KprobeTcpClose *ebpf.Program `ebpf:"kprobe_tcp_close"`
KprobeTcpConnect *ebpf.Program `ebpf:"kprobe_tcp_connect"`
KprobeTcpRcvEstablished *ebpf.Program `ebpf:"kprobe_tcp_rcv_established"`
KprobeTcpRecvmsg *ebpf.Program `ebpf:"kprobe_tcp_recvmsg"`
KprobeTcpSendmsg *ebpf.Program `ebpf:"kprobe_tcp_sendmsg"`
KretprobeSockAlloc *ebpf.Program `ebpf:"kretprobe_sock_alloc"`
KretprobeSysAccept4 *ebpf.Program `ebpf:"kretprobe_sys_accept4"`
KretprobeSysClone *ebpf.Program `ebpf:"kretprobe_sys_clone"`
KretprobeSysConnect *ebpf.Program `ebpf:"kretprobe_sys_connect"`
KretprobeTcpRecvmsg *ebpf.Program `ebpf:"kretprobe_tcp_recvmsg"`
KretprobeTcpSendmsg *ebpf.Program `ebpf:"kretprobe_tcp_sendmsg"`
SocketHttpFilter *ebpf.Program `ebpf:"socket__http_filter"`
}
func (p *bpf_debugPrograms) Close() error {
return _Bpf_debugClose(
p.KprobeSysExit,
p.KprobeTcpClose,
p.KprobeTcpConnect,
p.KprobeTcpRcvEstablished,
p.KprobeTcpRecvmsg,
p.KprobeTcpSendmsg,
p.KretprobeSockAlloc,
p.KretprobeSysAccept4,
p.KretprobeSysClone,
p.KretprobeSysConnect,
p.KretprobeTcpRecvmsg,
p.KretprobeTcpSendmsg,
p.SocketHttpFilter,
)
}
func _Bpf_debugClose(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 bpf_debug_bpfel_x86.o
var _Bpf_debugBytes []byte