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

Startup warnings in eBPF programs #141

Closed
1 of 2 tasks
MatteoNardi opened this issue Jan 30, 2023 · 0 comments · Fixed by #145
Closed
1 of 2 tasks

Startup warnings in eBPF programs #141

MatteoNardi opened this issue Jan 30, 2023 · 0 comments · Fixed by #145
Assignees
Labels
bug Something isn't working

Comments

@MatteoNardi
Copy link
Contributor

MatteoNardi commented Jan 30, 2023

Problem

On Pulsar startup, we're getting warnings on the eBPF side.

2023-01-30T10:31:20Z WARN  trace_pipe]    Socket Thread-3356    [006] d...1 11151.973875: [output_event] error -28 emitting event of len 104 (ERROR)
2023-01-30T10:31:20Z WARN  trace_pipe]    Socket Thread-3356    [005] d...1 11157.418291: [output_event] error -2 emitting event of len 104 (ERROR)

The warnings comes from the code sending the perf event in output.bpf.h:

https://github.com/Exein-io/pulsar/blob/c2ee6650337958488d86cdd8963502db88a42e08/crates/bpf-common/include/output.bpf.h#L63-L75

Analysis

  • Rather than a regression, I think the old code was simply ignoring these errors.
  • I believe the cause to be that on initialization we open the perf event map only after we've started the eBPF code. I guess that trying to emit events in that time-slice will result in these errors.

Todo

  • Find the exact meaning of error -2 and -28
    • -2 error is emitted on startup, when the map has not been setup yet on the userspace side
    • -28 error is emitted during shutdown, presumably when the eBPF program is still running, but the map buffer has been dropped.
  • Fix the warning by not emitting events until the perf event array map is initialized. We could do this add a configuration map with one entry (initialized=true/false). With the default value of false, the probes won't run. After we've opened the perf event map, in program.rs, we'll set it to true.
@MatteoNardi MatteoNardi added the bug Something isn't working label Jan 30, 2023
@MatteoNardi MatteoNardi self-assigned this Jan 30, 2023
@MatteoNardi MatteoNardi linked a pull request Jan 31, 2023 that will close this issue
4 tasks
@MatteoNardi MatteoNardi added this to the Q1 2023 - Runtime Beta milestone Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant