Akio Takebe
2008-Mar-27 13:05 UTC
[Xen-ia64-devel] [Patch][0/2]implement dump_execution_state() on ia64
Hi, This patch can show Calltraces at BUG_ON() on ia64. And this supports xm debug-key d on ia64. This patch needs to modify some common codes for supporting them. [1/2] x86 side: implement_dump_execution_state.x86.patch [2/2] ia64 side: implement_dump_execution_state.ia64.patch Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> Best Regards, Akio Takebe _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Akio Takebe
2008-Mar-27 13:09 UTC
[Xen-ia64-devel] [Patch][1/2]implement dump_execution_state() on ia64
Hi, This patch is x86 side. Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> Best Regards, Akio Takebe _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Akio Takebe
2008-Mar-27 13:10 UTC
[Xen-ia64-devel] [Patch][2/2]implement dump_execution_state() on ia64
Hi, This patch is ia64 side. Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com> Best Regards, Akio Takebe _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Keir Fraser
2008-Mar-27 14:47 UTC
Re: [Xen-devel] [Patch][0/2]implement dump_execution_state() on ia64
On 27/3/08 13:05, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:> This patch can show Calltraces at BUG_ON() on ia64. > And this supports xm debug-key d on ia64. > This patch needs to modify some common codes for supporting them.Can you carefully explain why the interface changes are required? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Akio Takebe
2008-Mar-27 16:56 UTC
[Xen-ia64-devel] Re: [Xen-devel] [Patch][0/2]implement dump_execution_state() on ia64
Hi, Keir>On 27/3/08 13:05, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote: > >> This patch can show Calltraces at BUG_ON() on ia64. >> And this supports xm debug-key d on ia64. >> This patch needs to modify some common codes for supporting them. > >Can you carefully explain why the interface changes are required? >IA64 needs unwind infomation to show the Calltrace. To make the unwind infomation, we needs switch stack and pt_regs. So if possible, I want to use pt_regs at geting a interrupt. I make many interface change because debug-key use IPI. But I just want to use pt_regs. Best Regards, Akio Takebe _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Keir Fraser
2008-Mar-27 17:04 UTC
Re: [Xen-devel] [Patch][0/2]implement dump_execution_state() on ia64
On 27/3/08 16:56, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:>> Can you carefully explain why the interface changes are required? >> > IA64 needs unwind infomation to show the Calltrace. > To make the unwind infomation, we needs switch stack and pt_regs. > So if possible, I want to use pt_regs at geting a interrupt. > > I make many interface change because debug-key use IPI. > But I just want to use pt_regs.There is already a function which does what you want (i.e., takes a cpu_user_regs pointer) -- it''s called show_execution_state(). On x86 we implement dump_execution_state() by forcing an exception (by executing an invalid opcode) and dumping the calltrace from within the exception handler. This works because the exception handler has a cpu_user_regs pointer and hence can call show_execution_state(). We use the same trick for handling BUG() and ASSERT(). The code concerned is in arch/x86/traps.c:do_invalid_op(). Can a similar thing be done on ia64? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Akio Takebe
2008-Mar-27 17:22 UTC
[Xen-ia64-devel] Re: [Xen-devel] [Patch][0/2]implement dump_execution_state() on ia64
Hi,>On 27/3/08 16:56, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote: > >>> Can you carefully explain why the interface changes are required? >>> >> IA64 needs unwind infomation to show the Calltrace. >> To make the unwind infomation, we needs switch stack and pt_regs. >> So if possible, I want to use pt_regs at geting a interrupt. >> >> I make many interface change because debug-key use IPI. >> But I just want to use pt_regs. > >There is already a function which does what you want (i.e., takes a >cpu_user_regs pointer) -- it''s called show_execution_state(). > >On x86 we implement dump_execution_state() by forcing an exception (by >executing an invalid opcode) and dumping the calltrace from within the >exception handler. This works because the exception handler has a >cpu_user_regs pointer and hence can call show_execution_state(). We use the >same trick for handling BUG() and ASSERT(). The code concerned is in >arch/x86/traps.c:do_invalid_op().On x86, does "xm debug-key d" make system hang? Or it just uses the exception handler, not hangup? Best Regards, Akio Takebe _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Keir Fraser
2008-Mar-27 19:22 UTC
Re: [Xen-devel] [Patch][0/2]implement dump_execution_state() on ia64
On 27/3/08 17:22, "Akio Takebe" <takebe_akio@jp.fujitsu.com> wrote:>> There is already a function which does what you want (i.e., takes a >> cpu_user_regs pointer) -- it''s called show_execution_state(). >> >> On x86 we implement dump_execution_state() by forcing an exception (by >> executing an invalid opcode) and dumping the calltrace from within the >> exception handler. This works because the exception handler has a >> cpu_user_regs pointer and hence can call show_execution_state(). We use the >> same trick for handling BUG() and ASSERT(). The code concerned is in >> arch/x86/traps.c:do_invalid_op(). > On x86, does "xm debug-key d" make system hang? > Or it just uses the exception handler, not hangup?It works fine. It uses dump_execution_state(), as you have seen when you modified it, and hence it does indeed force an exception on each CPU in turn, and the exception handler dumps the cpu_user_regs (also known as ''pt_regs'' in ia64) pointer that it receives. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel