MCPcopy Create free account
hub / github.com/iovisor/bcc / main

Function main

examples/cpp/KModRetExample.cc:172–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172int main() {
173 ebpf::BPF bpf;
174 auto res = bpf.init(BPF_PROGRAM);
175 if (!res.ok()) {
176 std::cerr << res.msg() << std::endl;
177 return 1;
178 }
179
180 uint32_t key = 0, val = getpid();
181 auto pid_table = bpf.get_array_table<uint32_t>("target_pid");
182 res = pid_table.update_value(key, val);
183 if (!res.ok()) {
184 std::cerr << res.msg() << std::endl;
185 return 1;
186 }
187
188 if (modify_return(bpf))
189 return 1;
190
191 if (not_modify_return(bpf))
192 return 1;
193
194 return 0;
195}

Callers

nothing calls this directly

Calls 5

modify_returnFunction · 0.85
not_modify_returnFunction · 0.85
initMethod · 0.45
okMethod · 0.45
update_valueMethod · 0.45

Tested by

no test coverage detected