git: 8f9f7b4a427f - main - procstat auxv: widen COMM column to MAXCOMLEN

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Mon, 16 Oct 2023 16:59:22 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f9f7b4a427f2518e978600794f013cb711dfb86

commit 8f9f7b4a427f2518e978600794f013cb711dfb86
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2023-10-16 16:53:53 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2023-10-16 16:58:54 +0000

    procstat auxv: widen COMM column to MAXCOMLEN
    
    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.
    
    Reviewed by:    markj
    Sponsored by:   DARPA
    Differential Revision:  https://reviews.freebsd.org/D42202
---
 usr.bin/procstat/procstat_auxv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usr.bin/procstat/procstat_auxv.c b/usr.bin/procstat/procstat_auxv.c
index 9c37c511d190..7b68ac72f724 100644
--- a/usr.bin/procstat/procstat_auxv.c
+++ b/usr.bin/procstat/procstat_auxv.c
@@ -53,16 +53,16 @@ procstat_auxv(struct procstat *procstat, struct kinfo_proc *kipp)
 	static char prefix[256];
 
 	if ((procstat_opts & PS_OPT_NOHEADER) == 0)
-		xo_emit("{T:/%5s %-16s %-16s %-16s}\n", "PID", "COMM", "AUXV",
+		xo_emit("{T:/%5s %-19s %-16s %-16s}\n", "PID", "COMM", "AUXV",
 		    "VALUE");
 
 	auxv = procstat_getauxv(procstat, kipp, &count);
 	if (auxv == NULL)
 		return;
-        snprintf(prefix, sizeof(prefix), "%5d %-16s", kipp->ki_pid,
-            kipp->ki_comm);
+	snprintf(prefix, sizeof(prefix), "%5d %-19s", kipp->ki_pid,
+	    kipp->ki_comm);
 
-	xo_emit("{e:process_id/%5d/%d}{e:command/%-16s/%s}", kipp->ki_pid,
+	xo_emit("{e:process_id/%5d/%d}{e:command/%-19s/%s}", kipp->ki_pid,
 	    kipp->ki_comm);
 
 	for (i = 0; i < count; i++) {