ps values with a "-", inexplicable?

Dewayne Geraghty dewayne at heuristicsystems.com.au
Thu Sep 24 02:06:37 UTC 2020


While parsing process information, things failed when expected numerical
values returned a "-".

Can anyone explain why they have a hyphen value? I would expect a zero
if unused ...

Examples
# ps -ax -o
pid,ppid,inblk,oublk,msgrcv,msgsnd,majflt,pri,nswap,nvcsw,nivcsw,command
-p 6553
  PID  PPID INBLK OUBLK MSGRCV MSGSND MAJFLT PRI NSWAP NVCSW NIVCSW COMMAND
 6553     1     -     -      -      -      -  52     -     -      -
adjkerntz -i


I first noticed the hyphens when a parser complained due to the parent
openkim returning hyphens similar to the above, but after a process
restart and two days of running the opendkim is returning an expected:

# ps -ax -o
pid,ppid,inblk,oublk,msgrcv,msgsnd,majflt,pri,nswap,nvcsw,nivcsw,command
|grep opendkim
49616     1     0       0        0        0      0  52     0         2
       0 /usr/local/sbin/opendkim -l -p /var/run/milteropendkim/sock -u
dkim:mailnull -P /var/run/milopendkim/pid -x /usr/local/etc/opendkim.conf

Any insight appreciated?

My objective is to examine processes that demonstrate excessive resource
use, and if the hyphens indicate no value, or for my purposes zero
resources then should I simple convert hyphens to zeros without loosing
information?

This is on
FreeBSD 12.2-STABLE FreeBSD 12.2-STABLE #0 r365645M: amd64 1202500 1202500



More information about the freebsd-questions mailing list