git: 67af9aba6b14 - main - Decode and report native eventfd descriptors from libprocstat and procstat.
Konstantin Belousov
kib at FreeBSD.org
Sun Dec 27 10:57:39 UTC 2020
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=67af9aba6b144789734289443a5f90a3ca716dbe
commit 67af9aba6b144789734289443a5f90a3ca716dbe
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2020-12-23 14:17:44 +0000
Commit: Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2020-12-27 10:57:27 +0000
Decode and report native eventfd descriptors from libprocstat and procstat.
Submitted by: greg at unrelenting.technology
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26668
---
lib/libprocstat/libprocstat.c | 5 +++++
lib/libprocstat/libprocstat.h | 1 +
usr.bin/procstat/procstat.1 | 2 ++
usr.bin/procstat/procstat_files.c | 5 +++++
4 files changed, 13 insertions(+)
diff --git a/lib/libprocstat/libprocstat.c b/lib/libprocstat/libprocstat.c
index 8d10c2900459..a2de61855815 100644
--- a/lib/libprocstat/libprocstat.c
+++ b/lib/libprocstat/libprocstat.c
@@ -628,6 +628,10 @@ procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmap
type = PS_FST_TYPE_DEV;
data = file.f_data;
break;
+ case DTYPE_EVENTFD:
+ type = PS_FST_TYPE_EVENTFD;
+ data = file.f_data;
+ break;
default:
continue;
}
@@ -719,6 +723,7 @@ kinfo_type2fst(int kftype)
{ KF_TYPE_SHM, PS_FST_TYPE_SHM },
{ KF_TYPE_SOCKET, PS_FST_TYPE_SOCKET },
{ KF_TYPE_VNODE, PS_FST_TYPE_VNODE },
+ { KF_TYPE_EVENTFD, PS_FST_TYPE_EVENTFD },
{ KF_TYPE_UNKNOWN, PS_FST_TYPE_UNKNOWN }
};
#define NKFTYPES (sizeof(kftypes2fst) / sizeof(*kftypes2fst))
diff --git a/lib/libprocstat/libprocstat.h b/lib/libprocstat/libprocstat.h
index 4ef34da75ec2..0624ec5289d4 100644
--- a/lib/libprocstat/libprocstat.h
+++ b/lib/libprocstat/libprocstat.h
@@ -72,6 +72,7 @@
#define PS_FST_TYPE_NONE 12
#define PS_FST_TYPE_PROCDESC 13
#define PS_FST_TYPE_DEV 14
+#define PS_FST_TYPE_EVENTFD 15
/*
* Special descriptor numbers.
diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1
index 174f932a9dde..1ce0b796beb4 100644
--- a/usr.bin/procstat/procstat.1
+++ b/usr.bin/procstat/procstat.1
@@ -313,6 +313,8 @@ The following file descriptor types may be displayed:
.Bl -tag -width X -compact
.It e
POSIX semaphore
+.It E
+eventfd
.It f
fifo
.It h
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c
index 74c6e48eab01..1d7b419b3f4a 100644
--- a/usr.bin/procstat/procstat_files.c
+++ b/usr.bin/procstat/procstat_files.c
@@ -414,6 +414,11 @@ procstat_files(struct procstat *procstat, struct kinfo_proc *kipp)
xo_emit("{eq:fd_type/dev}");
break;
+ case PS_FST_TYPE_EVENTFD:
+ str = "E";
+ xo_emit("{eq:fd_type/eventfd}");
+ break;
+
case PS_FST_TYPE_NONE:
str = "?";
xo_emit("{eq:fd_type/none}");
More information about the dev-commits-src-all
mailing list