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

fix #7. unsatisfied map reference #8

Merged
merged 1 commit into from
Jun 14, 2022
Merged
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
8 changes: 4 additions & 4 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func (m *Manager) GetMapSpec(name string) (*ebpf.MapSpec, bool, error) {
}

// editMapSpec -
func (m *Manager) editMapSpec(name string, mapSpec *ebpf.MapSpec) (error) {
func (m *Manager) editMapSpec(name string, mapSpec *ebpf.MapSpec) error {
m.stateLock.RLock()
defer m.stateLock.RUnlock()
if m.collectionSpec == nil || m.state < initialized {
Expand Down Expand Up @@ -919,7 +919,7 @@ func (m *Manager) CloneProgram(UID string, newProbe Probe, constantsEditors []Co
}

// Init
if err = newProbe.InitWithOptions(m, true, true); err != nil {
if err = newProbe.InitWithOptions(m, false, true); err != nil {
// clean up
_ = newProbe.Stop()
return errors.New(fmt.Sprintf("error:%v , failed to initialize new probe %v", err, newProbe.GetIdentificationPair()))
Expand Down Expand Up @@ -1256,8 +1256,8 @@ func (m *Manager) editConstant(prog *ebpf.ProgramSpec, editor ConstantEditor) er
// rewriteMaps - Rewrite the provided program spec with the provided maps
func (m *Manager) rewriteMaps(program *ebpf.ProgramSpec, eBPFMaps map[string]*ebpf.Map) error {
for symbol, eBPFMap := range eBPFMaps {
fd := eBPFMap.FD()
err := program.Instructions.RewriteMapPtr(symbol, fd)
//fd := eBPFMap.FD()
err := program.Instructions.AssociateMap(symbol, eBPFMap)
if err != nil {
return errors.New(fmt.Sprintf("error:%v , couldn't rewrite map %s", err, symbol))
}
Expand Down