svn commit: r355916 - head/sys/kern
Mark Johnston
markj at FreeBSD.org
Thu Dec 19 19:34:26 UTC 2019
Author: markj
Date: Thu Dec 19 19:34:25 2019
New Revision: 355916
URL: https://svnweb.freebsd.org/changeset/base/355916
Log:
Fix SIGINFO stack collection to ignore threads with swapped-out stacks.
We by definition cannot trace the stack of such a thread. Also remove a
redundant stack_zero() call in the SIGINFO handler, the stack structure
is cleared by the MD stack_capture().
Sponsored by: The FreeBSD Foundation
Modified:
head/sys/kern/tty_info.c
Modified: head/sys/kern/tty_info.c
==============================================================================
--- head/sys/kern/tty_info.c Thu Dec 19 18:22:11 2019 (r355915)
+++ head/sys/kern/tty_info.c Thu Dec 19 19:34:25 2019 (r355916)
@@ -338,8 +338,9 @@ tty_info(struct tty *tp)
pctcpu = (sched_pctcpu(td) * 10000 + FSCALE / 2) >> FSHIFT;
#ifdef STACK
if (tty_info_kstacks) {
- stack_zero(&stack);
- if (TD_IS_SWAPPED(td) || TD_IS_RUNNING(td))
+ if (TD_IS_SWAPPED(td))
+ sterr = ENOENT;
+ else if (TD_IS_RUNNING(td))
sterr = stack_save_td_running(&stack, td);
else {
stack_save_td(&stack, td);
More information about the svn-src-head
mailing list