Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Dec 2019 19:34:25 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r355916 - head/sys/kern
Message-ID:  <201912191934.xBJJYPSD080512@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912191934.xBJJYPSD080512>