[Crash-utility] [PATCH] Use only tasks on online CPUs for bt -a

Michael Holzheu holzheu at linux.vnet.ibm.com
Mon Apr 26 13:40:22 UTC 2010


Hello Dave,

Currently for "bt -a" also swapper tasks on offline CPUs are printed
(at least on s390). Wouldn't it be better to only print a backtrace,
when the task is running on an online CPU?

My suggestion would be to implement that with the following patch
by only setting the panic threads for online CPUs. I also attached a
second alternative patch that fills the active set array only with
tasks on online CPUs.

What do you think?

Michael
---
 task.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/task.c
+++ b/task.c
@@ -5658,8 +5658,12 @@ populate_panic_threads(void)
         struct task_context *tc;
 
 	if (get_active_set()) {
-		for (i = 0; i < NR_CPUS; i++) 
-			tt->panic_threads[i] = tt->active_set[i];
+		for (i = 0; i < NR_CPUS; i++) {
+			if (kt->cpu_flags[i] & ONLINE)
+				tt->panic_threads[i] = tt->active_set[i];
+			else
+				tt->panic_threads[i] = 0;
+		}
 		return;
 	}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-5.0.3-panic_threads-online.patch
Type: text/x-patch
Size: 477 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20100426/b3b4cf50/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crash-5.0.3-active_set-online.patch
Type: text/x-patch
Size: 1621 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20100426/b3b4cf50/attachment-0001.bin>


More information about the Crash-utility mailing list