Commit Graph

5 Commits

Author SHA1 Message Date
Christopher Haster b8d3a5ef46 Fixed inotify race conditions and fd leak in scripts
Since we were only registering our inotify reader after the previous
operation completed, it was easy to miss modifications that happened
faster than our scripts. Since our scripts are in Python, this happened
quite often and made it hard to trust the current state of scripts
with --keep-open, sort of defeating the purpose of --keep-open...

I think previously this race condition wasn't avoided because of the
potential to loop indefinitely if --keep-open referenced a file that the
script itself modified, but it's up to the user to avoid this if it is
an issue.

---

Also while fixing this, I noticed our use of the inotify_simple library
was leaking file descriptors everywhere! I just wasn't closing any
inotify objects at all. A bit concerning since scripts with --keep-open
can be quite long lived...
2023-12-06 22:23:38 -06:00
Christopher Haster e7bf5ad82f Added scripts/crc32c.py
This seems like a useful script to have.
2023-09-15 18:42:48 -05:00
Christopher Haster b43d2d2d9d In watch.py, fixed --keep-open-paths typo, made --keep-open implicit sometimes
So now:

  ./scripts/watch.py -K lfs.c ./script.sh

Does the reasonable thing.
2023-06-16 01:51:25 -05:00
Christopher Haster 27248ad3b6 Some script tweaks around dbgrbyd.py
- Fixed off-by-one id for unknown tags.

- Allowed block_size and block to go unspecified, assumes the block
  device is one big block in that case.

- Added --buffer and --ignore-errors to watch.py, making it a bit better
  for watching slow and sometimes error scripts, such as dbgrbyd.py when
  watching a block device under test.
2023-02-14 14:59:20 -06:00
Christopher Haster b2a2cc9a19 Added teepipe.py and watch.py 2022-11-15 13:38:13 -06:00