git: af96ccc6a508 - main - uifree(9): report non-zero values for all shared resources

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Fri, 20 Sep 2024 21:09:28 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=af96ccc6a5083ae9ed62dbb1d72674ca75948707

commit af96ccc6a5083ae9ed62dbb1d72674ca75948707
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-09-20 18:48:58 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-09-20 21:08:51 +0000

    uifree(9): report non-zero values for all shared resources
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/kern/kern_resource.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index d1a1d3ea3811..58723289af21 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1510,6 +1510,18 @@ uifree(struct uidinfo *uip)
 	if (uip->ui_vmsize != 0)
 		printf("freeing uidinfo: uid = %d, swapuse = %lld\n",
 		    uip->ui_uid, (unsigned long long)uip->ui_vmsize);
+	if (uip->ui_ptscnt != 0)
+		printf("freeing uidinfo: uid = %d, ptscnt = %ld\n",
+		    uip->ui_uid, uip->ui_ptscnt);
+	if (uip->ui_kqcnt != 0)
+		printf("freeing uidinfo: uid = %d, kqcnt = %ld\n",
+		    uip->ui_uid, uip->ui_kqcnt);
+	if (uip->ui_umtxcnt != 0)
+		printf("freeing uidinfo: uid = %d, umtxcnt = %ld\n",
+		    uip->ui_uid, uip->ui_umtxcnt);
+	if (uip->ui_pipecnt != 0)
+		printf("freeing uidinfo: uid = %d, pipecnt = %ld\n",
+		    uip->ui_uid, uip->ui_pipecnt);
 	free(uip, M_UIDINFO);
 }