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, Mar 24, 9:43 AM
Unknown Object (File)
Mon, Mar 23, 3:34 AM
Unknown Object (File)
Sun, Mar 22, 8:14 PM
Unknown Object (File)
Sat, Mar 21, 7:28 PM
Unknown Object (File)
Tue, Mar 17, 9:12 AM
Unknown Object (File)
Sun, Mar 15, 11:21 PM
Unknown Object (File)
Fri, Mar 13, 10:27 PM
Unknown Object (File)
Tue, Mar 10, 10:00 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 Not Applicable
Unit
Tests Not Applicable

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.