From f87a5f036bb5797435a4a475059380fbfee7ec23 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 4 Jul 2018 13:28:16 +0000 Subject: [PATCH] top: do not fall to the thread name if kernel cache of the process args is empty. Instead, use kvm_getargv() unconditionally to obtain the process arguments. It means that one additional sysctl(2) is performed there. Submitted by: Thomas Munro MFC after: 1 week Differential revision: https://reviews.freebsd.org/D16111 --- usr.bin/top/machine.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index bed80c508ce0..349351d5351d 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -951,7 +951,6 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags } } else { if (pp->ki_flag & P_SYSTEM || - pp->ki_args == NULL || (args = kvm_getargv(kd, pp, cmdlen)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS &&