From owner-dev-commits-src-main@freebsd.org Sun Dec 27 10:57:39 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74ECD4B6978; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D3d1b2mmfz4Sk3; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 433ED25D1C; Sun, 27 Dec 2020 10:57:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BRAvdfP013845; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BRAvd9O013844; Sun, 27 Dec 2020 10:57:39 GMT (envelope-from git) Date: Sun, 27 Dec 2020 10:57:39 GMT Message-Id: <202012271057.0BRAvd9O013844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 67af9aba6b14 - main - Decode and report native eventfd descriptors from libprocstat and procstat. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 67af9aba6b144789734289443a5f90a3ca716dbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Dec 2020 10:57:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=67af9aba6b144789734289443a5f90a3ca716dbe commit 67af9aba6b144789734289443a5f90a3ca716dbe Author: Konstantin Belousov AuthorDate: 2020-12-23 14:17:44 +0000 Commit: Konstantin Belousov CommitDate: 2020-12-27 10:57:27 +0000 Decode and report native eventfd descriptors from libprocstat and procstat. Submitted by: greg@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}");