iovisor / iovisor/bcc

Using bpf_for_each_map_elem helper with BCC

Open
#3,418 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Hi all,
I was trying to use the new `bpf_for_each_map_elem` helper within a BCC-based application.
I have modified the rewriter to support a new function so that the helper can be called in this way:

```
map.for_each_elem(callback_function, &data, 0);
```

However, I get the following error when trying to deploy the program (kernel 5.13rc1, LLVM10):
```
HINT: The 'unknown opcode' can happen if you reference a global or static variable, or data in read-only section.
```

I guess the problem is within the "callback_function", which is not correctly relocated.
Does anyone have an idea of how to solve this issue?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.