eunomia-bpf / bpftime

Userspace eBPF runtime for Observability, Network & General Extensions Framework
https://eunomia.dev/bpftime/
MIT License
801 stars 75 forks source link

runtime: remove attach type replace, rename filter to override #120

Closed Officeyutong closed 10 months ago

Officeyutong commented 10 months ago

This PR removes the implementation of attach type replace in the attach manager, and modifies tests that shipped with replace to override.

Replace and filter were unified to override now. The override callback was performed before the hooked function's execution. It has access to the arguments, and could override the return value of the hooked function using bpftime_set_retval. If bpftime_set_retval was called, the original function will not be executed. Otherwise, the execution of the hooked function was not affected.

Closes #112