[Crash-utility] [PATCH] Use only tasks on online CPUs for bt -a
Dave Anderson
anderson at redhat.com
Mon Apr 26 14:29:22 UTC 2010
----- "Michael Holzheu" <holzheu at linux.vnet.ibm.com> wrote:
> 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
I'd prefer not to leave them out of the various internal task arrays,
especially the active_set[] array. Regardless of their on/offline
status, they do still exist as tasks, have runqueues, etc.
If you're just worried about "bt -a", then why not just catch
the offline status in the for loop inside "if (active)" section
of cmd_bt()? Or just indicate some kind of "OFFLINE" status in
the output?
Dave
> ---
> 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;
> }
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
More information about the Crash-utility
mailing list