Skip to content
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

New API in Collection{Spec} for modifying global BPF variables #1542

Open
smagnani96 opened this issue Aug 8, 2024 · 1 comment · May be fixed by #1543
Open

New API in Collection{Spec} for modifying global BPF variables #1542

smagnani96 opened this issue Aug 8, 2024 · 1 comment · May be fixed by #1543
Assignees
Labels
enhancement New feature or request

Comments

@smagnani96
Copy link
Contributor

smagnani96 commented Aug 8, 2024

Describe the bug

-- Newbie here, text to be adjusted --

Opening this issue to discuss a possible enhancement to the library regarding the interaction with static/global variables in an eBPF program. AFAIU, the current state of the library doesn't allow to interact with such data, since the map containing these varaibles (".rodata", ".data", ".bss") are not emitted (referring to https://github.com/cilium/ebpf/blob/main/cmd/bpf2go/main.go#L367 and https://github.com/cilium/ebpf/blob/main/cmd/bpf2go/gen/output.go#L108).

Useful pointers:

  1. how to read global variables directly in a user-mode program #943
  2. https://stackoverflow.com/questions/78742654/how-does-mmaped-ebpf-map-shared-between-processes-synchronizes-operations

Ongoing effort:

  1. Map.Memory and ebpf.Variable support: https://github.com/ti-mo/ebpf/tree/tb/ebpf-variables
  2. bpf2go support for ebpf.Variable: add bpf2go support and wrappers for ebpf.Variable generation #1543 (rebased on https://github.com/ti-mo/ebpf/tree/tb/ebpf-variables plus some required hack)
@smagnani96 smagnani96 added the bug Something isn't working label Aug 8, 2024
@lmb
Copy link
Collaborator

lmb commented Aug 12, 2024

cc @ti-mo PTAL

@ti-mo ti-mo changed the title enhancement: API for interacting with static and global variables New API in Collection{Spec} for modifying global BPF variables Sep 5, 2024
@ti-mo ti-mo added enhancement New feature or request and removed bug Something isn't working labels Sep 5, 2024
@ti-mo ti-mo self-assigned this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants