From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
To: Maneesh Soni <maneesh@in.ibm.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>,
Badari Pulavarty <pbadari@us.ibm.com>,
Morton Andrew Morton <akpm@osdl.org>,
fastboot@lists.osdl.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Fastboot] kexec+kdump testing with 2.6.12-rc3-mm3
Date: Thu, 12 May 2005 16:58:07 +0530 [thread overview]
Message-ID: <20050512112807.GA21343@in.ibm.com> (raw)
In-Reply-To: <20050512102230.GB3870@in.ibm.com>
On Thu, May 12, 2005 at 10:25:37AM +0000, Maneesh Soni wrote:
> Following is a somewhat crude user defined command to dump stack for all the
> processes in the crashdump
>
>
> (gdb) define ps
> Type commands for definition of "ps".
> End with a line saying just "end".
> >set $tasks_off=((size_t)&((struct task_struct *)0)->tasks)
> >set $init_t=&init_task
> >set $next_t=(((char *)($init_t->tasks).next) - $tasks_off)
> >while ($next_t != $init_t)
> >set $next_t=(struct task_struct *)$next_t
> >print $next_t.comm
> >print $next_t.pid
> >x/40x $next_t.thread.esp
> >set $next_t=(char *)($next_t->tasks.next) - $tasks_off
> >end
> >end
Probably you need another loop here for iterating thr' all the
threads of a task? do_each_thread/while_each_thread macros give
the details.
Basically the macros can be modified as:
set $tasks_off=((size_t)&((struct task_struct *)0)->tasks)
set $pid_off=((size_t)&((struct task_struct *)0)->pids[1].pid_list.next)
set $init_t=&init_task
set $next_t=(((char *)($init_t->tasks).next) - $tasks_off)
while ($next_t != $init_t)
set $next_t=(struct task_struct *)$next_t
printf "\n%s:\n", $next_t.comm
printf "PID = %d\n", $next_t.pid
printf "Stack dump:\n"
x/40x $next_t.thread.esp
set $next_th=(((char *)$next_t->pids[1].pid_list.next) - $pid_off)
while ($next_th != $next_t)
set $next_th=(struct task_struct *)$next_th
printf "\n%s:\n", $next_th.comm
printf "PID = %d\n", $next_th.pid
printf "Stack dump:\n"
x/40x $next_th.thread.esp
set $next_th=(((char *)$next_th->pids[1].pid_list.next) - $pid_off)
end
set $next_t=(char *)($next_t->tasks.next) - $tasks_off
end
--
Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017
next prev parent reply other threads:[~2005-05-12 11:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1115769558.26913.1046.camel@dyn318077bld.beaverton.ibm.com>
2005-05-11 2:53 ` [Fastboot] kexec+kdump testing with 2.6.12-rc3-mm3 Vivek Goyal
2005-05-11 15:20 ` Badari Pulavarty
2005-05-12 5:44 ` Vivek Goyal
2005-05-12 10:22 ` Maneesh Soni
2005-05-12 11:28 ` Srivatsa Vaddagiri [this message]
2005-05-14 10:33 ` Alexander Nyberg
2005-05-16 8:36 ` Maneesh Soni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050512112807.GA21343@in.ibm.com \
--to=vatsa@in.ibm.com \
--cc=akpm@osdl.org \
--cc=fastboot@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maneesh@in.ibm.com \
--cc=pbadari@us.ibm.com \
--cc=vgoyal@in.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox