Page MenuHomeFreeBSD

procstat auxv: widen COMM column to MAXCOMLEN
ClosedPublic

Authored by brooks on Oct 13 2023, 6:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 11:52 PM
Unknown Object (File)
Sun, Oct 27, 12:17 AM
Unknown Object (File)
Oct 11 2024, 7:26 AM
Unknown Object (File)
Oct 11 2024, 7:12 AM
Unknown Object (File)
Oct 1 2024, 2:13 AM
Unknown Object (File)
Sep 19 2024, 4:49 AM
Unknown Object (File)
Sep 18 2024, 5:35 AM
Unknown Object (File)
Sep 18 2024, 3:13 AM
Subscribers

Details

Summary

For reasons unknown, procstat subcommands typically display the command
in a 16+overflow column format. However, the command may be up to
MAXCOMLEN (19) characters long causing the column to spill into the next
one. Since there's plenty of room in the auxv case, bump the column
width up to 19 to avoid this issue. While this is a format change 1)
users who want to parse the data should use libxo output and 2) this
makes it possible to parse reliably with cut.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 53978
Build 50868: arc lint + arc unit

Event Timeline

markj added inline comments.
usr.bin/procstat/procstat_auxv.c
56

Hmm, can you write "%-*s" and pass MAXCOMLEN as a parameter? It's just a suggestion, I'm not sure it's worth the effort.

This revision is now accepted and ready to land.Oct 13 2023, 6:58 PM
usr.bin/procstat/procstat_auxv.c
56

My conclusion was "no" or at least not usefully because of the e:command/%-19s/%s below where one case would consume it and another not. Maybe I could stringify the macro value, but that doesn't seem super readable :(

This revision was automatically updated to reflect the committed changes.