From owner-dev-commits-src-all@freebsd.org Fri Jan 1 00:03:59 2021 Return-Path: Delivered-To: dev-commits-src-all@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 EFA854D53FB; Fri, 1 Jan 2021 00:03:59 +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 4D6QH36TMgz4Z7Z; Fri, 1 Jan 2021 00:03:59 +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 CE0A319360; Fri, 1 Jan 2021 00:03:59 +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 10103xVD093731; Fri, 1 Jan 2021 00:03:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10103xdw093730; Fri, 1 Jan 2021 00:03:59 GMT (envelope-from git) Date: Fri, 1 Jan 2021 00:03:59 GMT Message-Id: <202101010003.10103xdw093730@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: ae450907c639 - main - Use kdb_thr_from_pid() in db_lookup_thread(). 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: ae450907c6394332063566b0009f7aa0c296133e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jan 2021 00:04:00 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=ae450907c6394332063566b0009f7aa0c296133e commit ae450907c6394332063566b0009f7aa0c296133e Author: John Baldwin AuthorDate: 2021-01-01 00:01:27 +0000 Commit: John Baldwin CommitDate: 2021-01-01 00:01:27 +0000 Use kdb_thr_from_pid() in db_lookup_thread(). The code is identical, so this should be a no-op. Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27828 --- sys/ddb/db_thread.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/ddb/db_thread.c b/sys/ddb/db_thread.c index e7619dc368fe..17b74c989ede 100644 --- a/sys/ddb/db_thread.c +++ b/sys/ddb/db_thread.c @@ -114,7 +114,6 @@ db_lookup_thread(db_expr_t addr, bool check_pid) { struct thread *td; db_expr_t decaddr; - struct proc *p; /* * If the parsed address was not a valid decimal expression, @@ -128,10 +127,9 @@ db_lookup_thread(db_expr_t addr, bool check_pid) if (td != NULL) return (td); if (check_pid) { - LIST_FOREACH(p, PIDHASH(decaddr), p_hash) { - if (p->p_pid == decaddr) - return (FIRST_THREAD_IN_PROC(p)); - } + td = kdb_thr_from_pid(decaddr); + if (td != NULL) + return (td); } return ((struct thread *)addr); }