[RFC PATCH v4 0/4] Proposal to add eventfd option to --decode-fds

Sahil Siddiq icegambit91 at gmail.com
Thu May 16 04:20:52 UTC 2024


Hi,

Currently, the --decode-fds option hasn't been implemented for
eventfd file descriptors. Having this option can help examine
eventfd object details that are associated with an eventfd file
descriptor. This is especially useful when multiple threads or
processes utilise (reading, writing, etc.) file descriptors
corresponding to the same eventfd object.

This proposal also includes a patch to implement this option.

Thanks,
Sahil

Changes v3 -> v4:
- src/util.c:
  (struct scan_fdinfo): Rename struct.
  (scan_fdinfo_lines):
  - Rename from "scan_fdinfo".
  - (prefix_matches): Use ++ instead of +=1.
  (scan_fdinfo): New wrapper function.
  (get_finfo_for_dev): Revert to use scan_fdinfo wrapper.
  (pidfd_get_pid): Likewise.
  (printsignalfd): Likewise.
  (parse_fdinfo_efd_counter):
  - Improve handling of newline/whitespace.
  - Improve handling of data buffer.
  (printeventfd): Free efd_counter buffer.
- tests/eventfd-yy.c:
  (procfs_check_avail_efd_data):
  - (matches): Use ++ instead of +=1.
  - Modify second "if" condition.
- NEWS: Document this change for next version.

Sahil Siddiq (4):
  Allow scanning of fdinfo fields in one pass
  Add eventfd option to --decode-fds
  Add test for --decode-fds=eventfd
  Document --decode-fds=eventfd implementation

 NEWS                 |   6 ++
 doc/strace.1.in      |   5 +-
 src/filter_qualify.c |   1 +
 src/number_set.h     |   1 +
 src/strace.c         |   3 +-
 src/util.c           | 148 +++++++++++++++++++++++++++++---
 tests/.gitignore     |   1 +
 tests/Makefile.am    |   1 +
 tests/eventfd-yy.c   | 196 +++++++++++++++++++++++++++++++++++++++++++
 tests/gen_tests.in   |   1 +
 10 files changed, 351 insertions(+), 12 deletions(-)
 create mode 100644 tests/eventfd-yy.c

-- 
2.45.0



More information about the Strace-devel mailing list