From nobody Tue Oct 15 15:05:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XScq92McVz5YYc1; Tue, 15 Oct 2024 15:05:41 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XScq90sJMz46Xg; Tue, 15 Oct 2024 15:05:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1sGuckltPoOq4U1AgAr3NR0d7SJ1cHP6yGWVhavNbE=; b=c0m5EvN5m0CwHsZr2pKDnqAwNwgZ8BenTREv1utskD0wyLAEdAcX8FV9jgxlp+rKDH4+wV OdCuPDFZwYWEpl5uk10oHJqlNNYrB1/MxeY7AuKRMnPglmY/HVVQe+pgX3b/z1fyxhgNpl +gLN5k6tIgfFVKUzs7rqT+ePEsMKEJJ8qynn50fHCCMftQuMmSe8q5VYVpPIuxrckO6KoC 86/gb5Tt9Nh+AcnKKU2vMMM3NAtoIrHHSbphXzkg3encCtEFkmDNh7TtFvpzM6HzoXxOUj fLrsm88gKA3K+yymkjdsv59h9u9t9cpawl1OZ49jf3Pkg25Xj0E/fSXXr3STZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Q1sGuckltPoOq4U1AgAr3NR0d7SJ1cHP6yGWVhavNbE=; b=VOsladVc3qTezEJqT0hGwI5wn6SXGYYtSqiIzmO06X2Z6yppWhR/7X5FdZgyMablPTq9Dd /B3i1K/9y3+uD8j9VywSdwxLMkogE1xce2qsgkqb0VznM5QIQEkJ9b0W96VoaogntJYGdJ KKGKzaOpMemCvuRsb6JgBmKtcB/SgbWEUOjQF+7Hxs0cJMPe6aulvu8mlyPclfOQNdIN34 Vf1FZOzJc+TGFp0BEf0y47/wc6BakHXHRPNddKtCa3SZgnGAK6ysgd4XEU3yJ2+qe8JWr+ 4tuGQICfb8/WxqB/9rg5cV5CnJqh8O2kgrXhMHCDOVTzPn8bNqXEERdedJURHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004741; a=rsa-sha256; cv=none; b=Pn7O2BZMRU2HNhh5ocOXqpndFWngTVDtQybE0VnGLCrsjIENACuINWCWFjrnEFn32UJf7H VdOYHBG8wKfFKdNTIuqt7Y8ezAKgQv6u5lVRzpwDcTI0ZpQ+XDzuAIBvxnsNOhl/Tw0Rmq D0RFn9UeJ9ZI++GsmjmcdEoHGLQ3XffhNdUo1i/aMX52tYzckLaAadPL6BroZdum4bpuJ6 TKKZc/qp/JsWc7onbX/jqaJtfvzeUB6rG8s0dnEHaJKrQsKfEI7mtA//ywS7BJDs4Q+tNm sWjSTZILOYpe5tdyullPwQy1mn4uqOXL8pGOisTnALtAsUZsVQMFDMtfLbrOyA== 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 4XScq90DmpzRcH; Tue, 15 Oct 2024 15:05:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49FF5eeA089900; Tue, 15 Oct 2024 15:05:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5eWf089897; Tue, 15 Oct 2024 15:05:40 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:40 GMT Message-Id: <202410151505.49FF5eWf089897@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: cdc72c496065 - stable/14 - kinfo_vmentry: report cdev name for device mappings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/stable/14 X-Git-Reftype: branch X-Git-Commit: cdc72c4960656d581fd566425de7bfa50b3ef654 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=cdc72c4960656d581fd566425de7bfa50b3ef654 commit cdc72c4960656d581fd566425de7bfa50b3ef654 Author: Konstantin Belousov AuthorDate: 2024-10-10 09:31:37 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 15:03:59 +0000 kinfo_vmentry: report cdev name for device mappings (cherry picked from commit ac9b565b1aa1adc359a5b0a0d83d0aea63643d62) --- sys/kern/kern_proc.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index f89ffde8b5be..b8bc1a7e5dfe 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -2615,9 +2616,11 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) struct ucred *cred; struct vnode *vp; struct vmspace *vm; + struct cdev *cdev; + struct cdevsw *csw; vm_offset_t addr; unsigned int last_timestamp; - int error; + int error, ref; key_t key; unsigned short seq; bool guard, super; @@ -2715,6 +2718,19 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_ref_count = obj->ref_count; kve->kve_shadow_count = obj->shadow_count; + if (obj->type == OBJT_DEVICE || + obj->type == OBJT_MGTDEVICE) { + cdev = obj->un_pager.devp.dev; + if (cdev != NULL) { + csw = dev_refthread(cdev, &ref); + if (csw != NULL) { + strlcpy(kve->kve_path, + cdev->si_name, sizeof( + kve->kve_path)); + dev_relthread(cdev, ref); + } + } + } VM_OBJECT_RUNLOCK(obj); if ((lobj->flags & OBJ_SYSVSHM) != 0) { kve->kve_flags |= KVME_FLAG_SYSVSHM;