diff options
author | John Baldwin <jhb@FreeBSD.org> | 2021-01-01 00:01:27 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2021-01-01 00:01:27 +0000 |
commit | ae450907c6394332063566b0009f7aa0c296133e (patch) | |
tree | 90d64d213c9108c5c3b43e20dc0e8f6c963d049d /sys/ddb | |
parent | 825d234144c5006e81c752bda7b9bcc2f822707e (diff) | |
download | src-ae450907c6394332063566b0009f7aa0c296133e.tar.gz src-ae450907c6394332063566b0009f7aa0c296133e.zip |
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
Diffstat (limited to 'sys/ddb')
-rw-r--r-- | sys/ddb/db_thread.c | 8 |
1 files 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); } |