Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (8)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughFreeBSD now calculates per-process block read and write operation rates from sampled counters. It provides read, write, and combined rate fields with display and sorting support. The default screens include an I/O screen, and the manual documents the FreeBSD rate units. Suggested reviewers: Priority: ⬇️ Low Change: Feature Merge Risk: ⚪ Minimal · up to The previously identified PID-reuse and column-alignment issues appear corrected. No actionable merge-blocking risk remains after normal checks.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Counters mark the passing time Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
0c40b2e7-0c6e-4b05-8a82-628e7878f360
📒 Files selected for processing (6)
freebsd/FreeBSDProcess.cfreebsd/FreeBSDProcess.hfreebsd/FreeBSDProcessTable.cfreebsd/Platform.cfreebsd/ProcessField.hhtop.1.in
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
62eb8b0 to
629a82b
Compare
BenBE
left a comment
There was a problem hiding this comment.
Are the normal IO rate values (B/s) available too or could that be added?
Linux and PCP provide a second default screen ("I/O") with per-process
I/O rate columns, but FreeBSD only ever shipped the "Main" screen.
Add an "I/O" screen with IO_OPS, IO_READ_OPS and IO_WRITE_OPS, plus the
same three columns to the available fields. The rates are derived from
the rusage block-operation counters (ki_rusage.ru_inblock and
ki_rusage.ru_oublock) already returned by the kvm_getprocs() call used
to enumerate processes, the same source the base system top(1) uses for
its "-m io" mode. As these counters report block operations rather than
bytes, the columns are named after the operation count, leaving the
"rate" suffix to the byte-rate columns.
Reuse across platforms is enabled by adding the generic
Row_printCountRate() helper to Row.c.
The default screen is only created when the configuration has no
screens section; existing configurations keep their own set of screens.
Assisted-by: DeepSeek V4.1 Flash
Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Add manual entries for IO_READ_OPS, IO_WRITE_OPS and IO_OPS, the FreeBSD columns reporting block operations per second. Assisted-by: DeepSeek V4.1 Flash Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
629a82b to
d1474e7
Compare
Not really |
|
@samm-git Full review of the PR will take some time. I noted the things that I noticed while skimming over in my initial review. AFAICT, FreeBSD's RACCT framework potentiall exposes |
Thank you for your reply. Somehow I was wrongly assuming that RACCT would not work for ZFS. However, the real problem is that |
What
Adds a second default screen, I/O, on FreeBSD with three new process columns:
IO_RATE(IO R/W)IO_READ_RATE(IO READ)IO_WRITE_RATE(IO WRITE)Linux and PCP already ship such a screen; FreeBSD only had Main.
How
The rates are computed from the per-process rusage block-operation counters
(
ki_rusage.ru_inblock/ru_oublock) that are already returned by the existingkvm_getprocs()call, i.e. the same data source the base systemtop(1)uses forits
-m iomode. No new syscalls and no privileges required.Because these counters count block operations rather than bytes, the columns
report operations per second, unlike their Linux counterparts (FreeBSD exposes
no unprivileged per-process byte counters). The manual page notes this difference.
Counters are refreshed on every scan, so switching to the I/O screen shows valid
rates immediately rather than a lifetime-sized first sample.
Testing
./configure --enable-unicode --enable-werror && makeon FreeBSD 14.5 (clang) - clean.I/Otab appears and shows live rates.(default screens are only created when no
screenssection is present).Notes
IO_PRIORITY,PERCENT_IO_DELAYandPERCENT_SWAP_DELAYare intentionally notadded: FreeBSD has no equivalent per-process I/O priority or delay accounting.
Assisted-by: DeepSeek V4.1 Flash