Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions module.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ func (m *Module) BPFLoadObject() error {
return nil
}

// Replace existing BPF object
// It helps to inject the eBPF skeleton file for replacing the loaded obj
func (m *Module) BPFReplaceExistingObject(obj unsafe.Pointer) error {
m.obj = (*C.struct_bpf_object)(obj)
if m.obj == nil {
return fmt.Errorf("BPFReplaceExistingObject failed")
}
return nil
}

// InitGlobalVariable sets global variables (defined in .data or .rodata)
// in bpf code. It must be called before the BPF object is loaded.
func (m *Module) InitGlobalVariable(name string, value interface{}) error {
Expand Down
Loading