Process perf events individually
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 3
Description
Hi,
after having some problems by processing individual events from a perf ring buffer (see #1894), I have discovered what it could me the root of my problem.
I have my callback function that stops and restarts the bpf program based on the events the bpf program send itself. Given this circular relationship I need to be able to control individual polls from the event buffer.
However I discovered that this is currently not possible as the poll is currently calling my callback function for all events in the buffer:
https://github.com/iovisor/bcc/blob/18d3814ca9f6bf36f3768a2d5fee0fbd55c11798/src/cc/perf_reader.c#L171-L175
Whan I need is that a call to perf_reader_poll matches to at most a single call to my callback function.
Is there a reason the current implementation processes all buffered events at once?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/cc/perf_reader.c at the poll loop linked in the issue, and trace how buffered perf events are dispatched to the callback. Confirm the requested one-event-per-poll behavior for perf_reader_poll; done means each call invokes the callback at most once while processing individual buffered events.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- operating-systems, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100