svn commit: r332567 - in stable/11: lib/libprocstat usr.bin/procstat
Edward Tomasz Napierala
trasz at FreeBSD.org
Mon Apr 16 14:39:35 UTC 2018
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}");
More information about the svn-src-all
mailing list