From nobody Fri Oct 11 10:15:08 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 4XQ2Ym5xLcz5Yf0P; Fri, 11 Oct 2024 10:15:08 +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 4XQ2Ym3Kw3z4GX9; Fri, 11 Oct 2024 10:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728641708; 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=JTRadKkQYIMOs8OOluy3VbF1XX4nfBWnPWraLC4dEuU=; b=HX/HkZRxJZdrqR9gEPf8x1tKxVL4NX+epSobTkLxkKV6hTYKYallOnljWfTrvRdVE9v68J AoktknmUaomqhSVMsbazFDzbnlgy64MDVcPW3nE4/kH8B7gWTsfJ5+m+/Dr5nY2y2RGj0X o+5/M4+zfuA1POze8xF2ufb6RSL/1zss1AWmeuNnt8qA/fPPYN2l5q3DOjqp5YbEVRuG44 nGN7tKuiWWd9yDIU/fbhcKqjhbmEfu7kWWWyhGkKH5wJbeKCp+Uy+XIH5dTnYVzY+qIfSB t/hbpJWP6aWhjDxxZIdKn1pmZJeJcBIE0j1cMPZCC0ko3Iw3Ap2i+HJj4P8S/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728641708; 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=JTRadKkQYIMOs8OOluy3VbF1XX4nfBWnPWraLC4dEuU=; b=d/PybmYS39aQo0Nw7ort2WOnTxWdj0LTuCzxdtladCmJKp7v7PEuyG+NEIcyQu0rGxaHyT AoKOoUSkEQ1L13PnBI0XGa4DqcFcoB7Z9AKQs3YWqNPGsb6CnAIqWtythPD+wPFMMdX4ud TgXXog8N6c/+PzRc8hkU7LJ45rKw9MfSaEXhbx3iEx3EkpWClyFwXJVZoosJDj3y0U61a5 3QqkUppyoK2W/iGdL6d9td6oG+zsofypPbci29egF1Poasumm/3l51L60zqbrxaG+Cl84M BAK9/dD0cZyoRXmIR01Sj7zg9trEW01VR3MgdG2HdzqaSKbyaA1ypLXHE6KzCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728641708; a=rsa-sha256; cv=none; b=Ufzo2+22uFDCrsBO6r/54XZWVEoHmkWAJO0kKwSn1gHhfyGxehOZZ1ikDdhpz5pbhQilqP NLMQ0EOQ19nPxN8KQBDzQ5ndFQcu1sFgeuHsq9JfYmFRt4nVXMLYPrDHGW1KZwmqyyIkpc Ij+lF2iHneFT3gTNCUkhH1DtJ8zxXRd4t1vS6RP+a3gFp+wM0/hWc+Pcv48q/s5Rc25W6V lRH1ZBBvgObi4bUcGZpipQSo5NTZujFT2BrXFB/536xj27oBYdrwsXQbvaoSALJI1Vcu5c VNBB+QzLMzGl0W+fsuRTwbV8UNyX3ASsW3FquG7x+BbRkpPUkqm4O7tMjPaX+A== 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 4XQ2Ym2mQbzdYw; Fri, 11 Oct 2024 10:15:08 +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 49BAF8gE011943; Fri, 11 Oct 2024 10:15:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BAF89M011940; Fri, 11 Oct 2024 10:15:08 GMT (envelope-from git) Date: Fri, 11 Oct 2024 10:15:08 GMT Message-Id: <202410111015.49BAF89M011940@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: ac9b565b1aa1 - main - 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/main X-Git-Reftype: branch X-Git-Commit: ac9b565b1aa1adc359a5b0a0d83d0aea63643d62 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ac9b565b1aa1adc359a5b0a0d83d0aea63643d62 commit ac9b565b1aa1adc359a5b0a0d83d0aea63643d62 Author: Konstantin Belousov AuthorDate: 2024-10-10 09:31:37 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-11 10:14:04 +0000 kinfo_vmentry: report cdev name for device mappings Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47038 --- 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 1e90116f1cb0..f3ecaf4e2547 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -2614,9 +2615,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; @@ -2714,6 +2717,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;