This modifies the perf_reader polling logic for bpfd to include stdin
into the collection of file descriptors to poll when polling perf_reader
file descriptors.
This allows bpfd to be able to react to user input via stdin immediately as
opposed to before where it had to wait for the poll() to return before it
could address user input.
This fixes a bug where bcc tools like opensnoop.py refused to terminate
right away when interrupted with SIGINT (for example via Ctrl+C) since
it was still waiting for bpfd to respond to a command that bpfd failed to
respond to right away since it was still waiting for poll() to return.
This was tested with opensnoop.py (with this BCC-side fix applied), and it terminated properly even when bpfd was in the middle of polling perf_readers.
This modifies the perf_reader polling logic for bpfd to include stdin into the collection of file descriptors to poll when polling perf_reader file descriptors.
This allows bpfd to be able to react to user input via stdin immediately as opposed to before where it had to wait for the poll() to return before it could address user input.
This fixes a bug where bcc tools like opensnoop.py refused to terminate right away when interrupted with SIGINT (for example via Ctrl+C) since it was still waiting for bpfd to respond to a command that bpfd failed to respond to right away since it was still waiting for poll() to return.
Signed-off-by: Jazel Canseco jcanseco@google.com
Fixes #18