inspektor-gadget

Форк
0
/
execruntime_bpfel_arm64.go 
141 строка · 3.5 Кб
1
// Code generated by bpf2go; DO NOT EDIT.
2
//go:build arm64
3

4
package containerhook
5

6
import (
7
	"bytes"
8
	_ "embed"
9
	"fmt"
10
	"io"
11

12
	"github.com/cilium/ebpf"
13
)
14

15
type execruntimeRecord struct {
16
	Pid        uint32
17
	ArgsSize   uint32
18
	CallerComm [16]uint8
19
	Args       [15360]uint8
20
}
21

22
// loadExecruntime returns the embedded CollectionSpec for execruntime.
23
func loadExecruntime() (*ebpf.CollectionSpec, error) {
24
	reader := bytes.NewReader(_ExecruntimeBytes)
25
	spec, err := ebpf.LoadCollectionSpecFromReader(reader)
26
	if err != nil {
27
		return nil, fmt.Errorf("can't load execruntime: %w", err)
28
	}
29

30
	return spec, err
31
}
32

33
// loadExecruntimeObjects loads execruntime and converts it into a struct.
34
//
35
// The following types are suitable as obj argument:
36
//
37
//	*execruntimeObjects
38
//	*execruntimePrograms
39
//	*execruntimeMaps
40
//
41
// See ebpf.CollectionSpec.LoadAndAssign documentation for details.
42
func loadExecruntimeObjects(obj interface{}, opts *ebpf.CollectionOptions) error {
43
	spec, err := loadExecruntime()
44
	if err != nil {
45
		return err
46
	}
47

48
	return spec.LoadAndAssign(obj, opts)
49
}
50

51
// execruntimeSpecs contains maps and programs before they are loaded into the kernel.
52
//
53
// It can be passed ebpf.CollectionSpec.Assign.
54
type execruntimeSpecs struct {
55
	execruntimeProgramSpecs
56
	execruntimeMapSpecs
57
}
58

59
// execruntimeSpecs contains programs before they are loaded into the kernel.
60
//
61
// It can be passed ebpf.CollectionSpec.Assign.
62
type execruntimeProgramSpecs struct {
63
	IgExecveE *ebpf.ProgramSpec `ebpf:"ig_execve_e"`
64
	IgExecveX *ebpf.ProgramSpec `ebpf:"ig_execve_x"`
65
	IgFaPickE *ebpf.ProgramSpec `ebpf:"ig_fa_pick_e"`
66
	IgFaPickX *ebpf.ProgramSpec `ebpf:"ig_fa_pick_x"`
67
}
68

69
// execruntimeMapSpecs contains maps before they are loaded into the kernel.
70
//
71
// It can be passed ebpf.CollectionSpec.Assign.
72
type execruntimeMapSpecs struct {
73
	ExecArgs    *ebpf.MapSpec `ebpf:"exec_args"`
74
	IgFaPickCtx *ebpf.MapSpec `ebpf:"ig_fa_pick_ctx"`
75
	IgFaRecords *ebpf.MapSpec `ebpf:"ig_fa_records"`
76
}
77

78
// execruntimeObjects contains all objects after they have been loaded into the kernel.
79
//
80
// It can be passed to loadExecruntimeObjects or ebpf.CollectionSpec.LoadAndAssign.
81
type execruntimeObjects struct {
82
	execruntimePrograms
83
	execruntimeMaps
84
}
85

86
func (o *execruntimeObjects) Close() error {
87
	return _ExecruntimeClose(
88
		&o.execruntimePrograms,
89
		&o.execruntimeMaps,
90
	)
91
}
92

93
// execruntimeMaps contains all maps after they have been loaded into the kernel.
94
//
95
// It can be passed to loadExecruntimeObjects or ebpf.CollectionSpec.LoadAndAssign.
96
type execruntimeMaps struct {
97
	ExecArgs    *ebpf.Map `ebpf:"exec_args"`
98
	IgFaPickCtx *ebpf.Map `ebpf:"ig_fa_pick_ctx"`
99
	IgFaRecords *ebpf.Map `ebpf:"ig_fa_records"`
100
}
101

102
func (m *execruntimeMaps) Close() error {
103
	return _ExecruntimeClose(
104
		m.ExecArgs,
105
		m.IgFaPickCtx,
106
		m.IgFaRecords,
107
	)
108
}
109

110
// execruntimePrograms contains all programs after they have been loaded into the kernel.
111
//
112
// It can be passed to loadExecruntimeObjects or ebpf.CollectionSpec.LoadAndAssign.
113
type execruntimePrograms struct {
114
	IgExecveE *ebpf.Program `ebpf:"ig_execve_e"`
115
	IgExecveX *ebpf.Program `ebpf:"ig_execve_x"`
116
	IgFaPickE *ebpf.Program `ebpf:"ig_fa_pick_e"`
117
	IgFaPickX *ebpf.Program `ebpf:"ig_fa_pick_x"`
118
}
119

120
func (p *execruntimePrograms) Close() error {
121
	return _ExecruntimeClose(
122
		p.IgExecveE,
123
		p.IgExecveX,
124
		p.IgFaPickE,
125
		p.IgFaPickX,
126
	)
127
}
128

129
func _ExecruntimeClose(closers ...io.Closer) error {
130
	for _, closer := range closers {
131
		if err := closer.Close(); err != nil {
132
			return err
133
		}
134
	}
135
	return nil
136
}
137

138
// Do not access this directly.
139
//
140
//go:embed execruntime_bpfel_arm64.o
141
var _ExecruntimeBytes []byte
142

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.