From nobody Wed Jan 29 15:04:45 2025 X-Original-To: dev-commits-src-main@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 4Yjln962ZZz5ms6C; Wed, 29 Jan 2025 15:04:45 +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 4Yjln92xl8z3Qk4; Wed, 29 Jan 2025 15:04:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738163085; 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=N3pJ7ken3rIM9oSVUqjg4Y5Pm/xfCl9qBcgMmuPCimk=; b=sFpBcuEGpbG/bbdsltkEJSHItEllx9Phccp3ilVUwUArjN6akQByrdSLFUgB/x68stWNHy jN/pcDG44P4R7soWQvnVmEJP5vsS42TiyvWsP9EOFeQA4OOk7lkMzte4RaLXcDqRdOwPP/ 3xuKwiHTd3x4D1j/AT+7cs+IJCrfXnzqiIEtyV80ijtp4xnmLKVSj0HlhITDBrkEg3yZat etyAoptVP6qsDhuFmoYTd9iuI+DWpi/m63kKD/Ez7Lar8LZqZsTr6QctdDc7VAYBRezfe5 A4ehw+MnqISJ+822jjmz3mLvMJDX6/NXUxS9WAfe5FnCjbbhtFWmvT8df5uxiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738163085; 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=N3pJ7ken3rIM9oSVUqjg4Y5Pm/xfCl9qBcgMmuPCimk=; b=xiXqP3mF+8CicXR7vB6tpZSqOct+NNQke0wUb3Nw4KYoOkMzuXtktvlQTih5EaOVOoSs4l iLe992mx5TnssCo5jlVVE1Dii3PovzxqHmRHBsaOJ/qZirCcDCZWCOsydedeudgl5AUBcl 9Q30Z4nOYicGK6XYTOQiCm9dt4tiLBFDfgM47NngPR2gD+XDbwZnb7up5NdCZlvtUXe/l0 UX6kCzhBIF/30IZJauKDVluDY9LmNwZMHxvVzKc7cdLPdYTiiLXL1M7/7E/sTfgPnG0KMa D6IhRNsg6WY7bRCCSi9ytkhZ5SFWmWIXgaHZoBLjT1zZ5esRnvn4wsvdTmF2VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738163085; a=rsa-sha256; cv=none; b=L3Im+ZtRFr9UFO6weKceZitxzUjdVkX90xuYHuDaPH+W7HtNnMYHLE5apgF+PBykSBSM8V tFLe+c6QtNuNwqUCpg8XLv3BwSJ+oz24ty9awPvvFSizGdzp5LW14kVFxlDWVy16Q2bjBD vkW9lYinVf6m5PItroOIKkLZkD4FHh1wZ/uek48w8rRK3SJ6/IbJZnO6bUd2d75Wj10Kd9 PGpWRCBqh4fmvennNoDaUwJZ31Zs87l8UXF8xpyuCqEtDu+rzAgRR+kbxzGlFjA43ygH6T 5OIFxHdBUVACF0bCpWg5coTmFVvDM0TR+Sc8kPHD1uGUWpfKDjbdUaTaqkjG9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Yjln92QVwz15yL; Wed, 29 Jan 2025 15:04:45 +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 50TF4jMR032585; Wed, 29 Jan 2025 15:04:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50TF4joH032582; Wed, 29 Jan 2025 15:04:45 GMT (envelope-from git) Date: Wed, 29 Jan 2025 15:04:45 GMT Message-Id: <202501291504.50TF4joH032582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b8529e7c5e5b - main - devinfo: Distinguish resources owned by unnamed devices from free resources List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8529e7c5e5b298ed2d06a60407653fce0759363 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b8529e7c5e5b298ed2d06a60407653fce0759363 commit b8529e7c5e5b298ed2d06a60407653fce0759363 Author: John Baldwin AuthorDate: 2025-01-29 15:04:21 +0000 Commit: John Baldwin CommitDate: 2025-01-29 15:04:21 +0000 devinfo: Distinguish resources owned by unnamed devices from free resources For resources owned by an unnamed device, list the device name as "(unknown)" instead of using "----". In addition, if the -v flag is given, output the pnpinfo and location info for the device if present. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D48676 --- usr.sbin/devinfo/devinfo.8 | 2 +- usr.sbin/devinfo/devinfo.c | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/devinfo/devinfo.8 b/usr.sbin/devinfo/devinfo.8 index f2b9a5d5cbaf..714b2df81935 100644 --- a/usr.sbin/devinfo/devinfo.8 +++ b/usr.sbin/devinfo/devinfo.8 @@ -35,7 +35,7 @@ .Nm .Op Fl rv .Nm -.Fl u +.Fl u Op Fl v .Nm .Fl p Ar dev Op Fl v .Sh DESCRIPTION diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c index 25d5a3a36db2..e8dd74b71144 100644 --- a/usr.sbin/devinfo/devinfo.c +++ b/usr.sbin/devinfo/devinfo.c @@ -185,8 +185,16 @@ print_rman_resource(struct devinfo_res *res, void *arg __unused) printf(" "); print_resource(res); dev = devinfo_handle_to_device(res->dr_device); - if ((dev != NULL) && (dev->dd_name[0] != 0)) { - printf(" (%s)", dev->dd_name); + if (dev != NULL) { + if (dev->dd_name[0] != 0) { + printf(" (%s)", dev->dd_name); + } else { + printf(" (unknown)"); + if (vflag && *dev->dd_pnpinfo) + printf(" pnpinfo %s", dev->dd_pnpinfo); + if (vflag && *dev->dd_location) + printf(" at %s", dev->dd_location); + } } else { printf(" ----"); } @@ -233,7 +241,7 @@ usage(void) { fprintf(stderr, "%s\n%s\n%s\n", "usage: devinfo [-rv]", - " devinfo -u", + " devinfo -u [-v]", " devinfo -p dev [-v]"); exit(1); }