summaryrefslogtreecommitdiff
path: root/usr.bin/pkill
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2012-04-12 14:59:20 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2012-04-12 14:59:20 +0000
commitf63ee3a6ce91574448645ed33a0b6a1364e3afc5 (patch)
treeb8082a6a211be23de65284e8aa21285f859f73c3 /usr.bin/pkill
parent22c2bfb88e8c394dc20c81832688dd203d02dd8b (diff)
Add per thread accounting, mainly for usage & friends.
This expands the already bloated FILL_KPROC macro to take an extra parameter that indicates if the callee is a thread or a process. The userland bits are adjusted accordingly and ps(1) and top(1) now display per thread usage times when -H is used. Also pkill(1) had to be adjusted so that duplicates don't pop up. libkvm does basically the same thing as the kernel bits. Okay guenther@.
Diffstat (limited to 'usr.bin/pkill')
-rw-r--r--usr.bin/pkill/pkill.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 34681f4fc2e..8b09439992f 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkill.c,v 1.25 2012/03/13 09:44:49 sthen Exp $ */
+/* $OpenBSD: pkill.c,v 1.26 2012/04/12 14:59:19 pirofti Exp $ */
/* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */
/*-
@@ -257,6 +257,8 @@ main(int argc, char **argv)
if ((kp->p_flag & (P_SYSTEM | P_THREAD)) != 0 ||
kp->p_pid == mypid)
continue;
+ if (kp->p_tid != -1)
+ continue;
if (matchargs) {
if ((pargv = kvm_getargv(kd, kp, 0)) == NULL)