-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split logic #367
Merged
Merged
Split logic #367
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geyslan
force-pushed
the
split-logic
branch
5 times, most recently
from
August 28, 2023 14:20
43828fa
to
10d3c2e
Compare
This only moves code around, no functional changes.
It has no methods, and is only used embedded in the BPFLink type.
- Changed C function returns to 'retC' in functions that return error values to avoid confusion with possible use of errno. - Changed returns to 'valueC' in functions that return 'value' or pointers to 'value'. This also changed comparisons to "< 0" instead of "!= 0".
Introduced struct helpers to manage the C struct lifecycle on the C side, which avoids problems with structs which may contain bitfields. See aquasecurity#244. - cgo_bpf_map_info_new() - cgo_bpf_map_info_size() - cgo_bpf_map_info_free() - cgo_bpf_tc_opts_new() - cgo_bpf_tc_opts_free() - cgo_bpf_tc_hook_new() - cgo_bpf_tc_hook_free() Based on the same aquasecurity#244 concerns, introduced bpf_map_info getters: - cgo_bpf_map_info_type() - cgo_bpf_map_info_id() - cgo_bpf_map_info_key_size() - cgo_bpf_map_info_value_size() - cgo_bpf_map_info_max_entries() - cgo_bpf_map_info_map_flags() - cgo_bpf_map_info_name() - cgo_bpf_map_info_ifindex() - cgo_bpf_map_info_btf_vmlinux_value_type_id() - cgo_bpf_map_info_netns_dev() - cgo_bpf_map_info_netns_ino() - cgo_bpf_map_info_btf_id() - cgo_bpf_map_info_btf_key_type_id() - cgo_bpf_map_info_btf_value_type_id() - cgo_bpf_map_info_map_extra() - cgo_bpf_tc_opts_prog_fd() - cgo_bpf_tc_opts_flags() - cgo_bpf_tc_opts_prog_id() - cgo_bpf_tc_opts_handle() - cgo_bpf_tc_opts_priority() Changed these functions to use cgo_* struct handlers: - NewModuleFromFileArgs() - GetMapInfoByFD() - TcHook.Destroy() - TcHook.Attach() - TcHook.Detach() - TcHook.Query()
SetStrictMode is no-op as of libbpf v1.0.
The underlying bpf_link__unpin() does not receive a pointer to the pin path, only for the link itself.
Applied the use of 'defer' for better resource management.
The API must rely on the program name returned by the libbpf API.
This adds spaces to the code to make it more readable. This also puts RingBuffer.Stop() and PerfBuffer.Stop() happy path out of the branching logic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close: #355
Close: #365
Close: #159
Close: #357
commit f1738f9 (HEAD -> split-logic, origin/split-logic)
commit 62f0ccc
commit 0228f12
commit 77c521f
commit 87088b6
commit 3aeb45b
commit 1b882cf
commit 913d1ea
commit a4c5f50
commit 0c6a05f
commit c192943