From owner-svn-src-stable@freebsd.org Mon Apr 16 14:39:35 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CEB8F8823C; Mon, 16 Apr 2018 14:39:35 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC95739D1; Mon, 16 Apr 2018 14:39:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A72A31EA13; Mon, 16 Apr 2018 14:39:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3GEdY9m041895; Mon, 16 Apr 2018 14:39:34 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3GEdYW6041888; Mon, 16 Apr 2018 14:39:34 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201804161439.w3GEdYW6041888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 16 Apr 2018 14:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r332567 - in stable/11: lib/libprocstat usr.bin/procstat X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in stable/11: lib/libprocstat usr.bin/procstat X-SVN-Commit-Revision: 332567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 14:39:35 -0000 Author: trasz Date: Mon Apr 16 14:39:34 2018 New Revision: 332567 URL: https://svnweb.freebsd.org/changeset/base/332567 Log: MFC r324237: Make procstat(1) recognize process descriptors, so that it shows "P" instead of "?" in "procstat -af" output. Note that there are still a few more DTYPE_* kinds we don't decode yet. Sponsored by: DARPA, AFRL Modified: stable/11/lib/libprocstat/libprocstat.c stable/11/lib/libprocstat/libprocstat.h stable/11/usr.bin/procstat/procstat.1 stable/11/usr.bin/procstat/procstat_files.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libprocstat/libprocstat.c ============================================================================== --- stable/11/lib/libprocstat/libprocstat.c Mon Apr 16 14:39:04 2018 (r332566) +++ stable/11/lib/libprocstat/libprocstat.c Mon Apr 16 14:39:34 2018 (r332567) @@ -579,6 +579,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struc type = PS_FST_TYPE_SHM; data = file.f_data; break; + case DTYPE_PROCDESC: + type = PS_FST_TYPE_PROCDESC; + data = file.f_data; + break; default: continue; } @@ -662,6 +666,7 @@ kinfo_type2fst(int kftype) int kf_type; int fst_type; } kftypes2fst[] = { + { KF_TYPE_PROCDESC, PS_FST_TYPE_PROCDESC }, { KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO }, { KF_TYPE_FIFO, PS_FST_TYPE_FIFO }, { KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE }, Modified: stable/11/lib/libprocstat/libprocstat.h ============================================================================== --- stable/11/lib/libprocstat/libprocstat.h Mon Apr 16 14:39:04 2018 (r332566) +++ stable/11/lib/libprocstat/libprocstat.h Mon Apr 16 14:39:34 2018 (r332567) @@ -68,6 +68,7 @@ #define PS_FST_TYPE_SEM 10 #define PS_FST_TYPE_UNKNOWN 11 #define PS_FST_TYPE_NONE 12 +#define PS_FST_TYPE_PROCDESC 13 /* * Special descriptor numbers. Modified: stable/11/usr.bin/procstat/procstat.1 ============================================================================== --- stable/11/usr.bin/procstat/procstat.1 Mon Apr 16 14:39:04 2018 (r332566) +++ stable/11/usr.bin/procstat/procstat.1 Mon Apr 16 14:39:34 2018 (r332567) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2017 +.Dd October 3, 2017 .Dt PROCSTAT 1 .Os .Sh NAME @@ -212,6 +212,8 @@ shared memory kqueue .It m message queue +.It P +process descriptor .It p pipe .It s Modified: stable/11/usr.bin/procstat/procstat_files.c ============================================================================== --- stable/11/usr.bin/procstat/procstat_files.c Mon Apr 16 14:39:04 2018 (r332566) +++ stable/11/usr.bin/procstat/procstat_files.c Mon Apr 16 14:39:34 2018 (r332567) @@ -402,6 +402,11 @@ procstat_files(struct procstat *procstat, struct kinfo xo_emit("{eq:fd_type/sem}"); break; + case PS_FST_TYPE_PROCDESC: + str = "P"; + xo_emit("{eq:fd_type/procdesc}"); + break; + case PS_FST_TYPE_NONE: str = "?"; xo_emit("{eq:fd_type/none}");