iovisor / iovisor/bcc

Process perf events individually

Open
#1,896 2 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.