Skip to content

Commit 69a86c2

Browse files
committed
Add perf_event_output boilerplate
1 parent 6b92a16 commit 69a86c2

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

examples/execve5.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def hello(ctx: c_void_p) -> c_int32:
2727
dataobj.pid = process_id
2828
dataobj.ts = ts
2929
print(f"clone called at {ts} by pid {process_id}")
30+
events.output(dataobj)
3031
return c_int32(0)
3132

3233

pythonbpf/bpf_helper_handler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,18 @@ def bpf_get_current_pid_tgid_emitter(call, map_ptr, module, builder, func, local
340340
return pid
341341

342342

343+
def bpf_perf_event_output_handler(call, map_ptr, module, builder, local_sym_tab=None):
344+
pass
345+
346+
343347
helper_func_list = {
344348
"lookup": bpf_map_lookup_elem_emitter,
345349
"print": bpf_printk_emitter,
346350
"ktime": bpf_ktime_get_ns_emitter,
347351
"update": bpf_map_update_elem_emitter,
348352
"delete": bpf_map_delete_elem_emitter,
349353
"pid": bpf_get_current_pid_tgid_emitter,
354+
"output": bpf_perf_event_output_handler,
350355
}
351356

352357

pythonbpf/maps.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ def __init__(self, key_size, value_size):
3030
self.key_type = key_size
3131
self.value_type = value_size
3232
self.entries = {}
33+
34+
def output(self, data):
35+
pass # Placeholder for output method

0 commit comments

Comments
 (0)