Skip to content

perf: fix breaking error for creating over perf ring from a loaded pr…#78

Closed
iAklis wants to merge 1 commit intocilium:masterfrom
iAklis:master
Closed

perf: fix breaking error for creating over perf ring from a loaded pr…#78
iAklis wants to merge 1 commit intocilium:masterfrom
iAklis:master

Conversation

@iAklis
Copy link
Copy Markdown

@iAklis iAklis commented Mar 10, 2020

Keep same behavior with libbpf.

The ABI max_entries of in BPF_MAP_TYPE_PERF_EVENT_ARRAY elf is more like a guidance than an exact value.

I'm glad someone reviewed the code for me.

@lmb
Copy link
Copy Markdown
Contributor

lmb commented Mar 10, 2020

Thank your for the pull request! I'd prefer the approach I mentioned in: #58 (review)

Change the perf ring code in perf to try and create a ring for each slot in the PerfEventArray, and ignore errors due to offline CPUs.

That way the fix for your issue also partially fixes the issue with hotplugged CPUs.

According to man 2 perf_event_open, the syscall fails with EINVAL if the CPU doesn't exist. Problem: there are a bunch of other reasons why that is returned. Maybe we can ignore EINVAL errors, and then at the end check that we created at least a single event ring.

Are you up for that? If not, I'll try and get to this sometime in the next days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants