Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1397636
| From | Baoquan He <bhe@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels |
| Date | 2016-05-10 03:50 +0200 |
| Message-ID | <rx4Ya-OL-15@gated-at.bofh.it> (permalink) |
| References | <r65yA-5kc-47@gated-at.bofh.it> <rswLo-1cD-23@gated-at.bofh.it> <rwLLQ-64x-5@gated-at.bofh.it> <rwSkh-5t9-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Corey,
On 05/09/16 at 07:10am, Corey Minyard wrote:
> >>>diff --git a/Documentation/kdump/gdbmacros.txt b/Documentation/kdump/gdbmacros.txt
> >>>index 9b9b454..e5bbd8d 100644
> >>>--- a/Documentation/kdump/gdbmacros.txt
> >>>+++ b/Documentation/kdump/gdbmacros.txt
> >>>@@ -54,42 +54,43 @@ document bttnobp
> >>> dump all thread stack traces on a kernel compiled with !CONFIG_FRAME_POINTER
> >>> end
> >>>+define btthreadstruct
> >This is a nice wrapping, but I guess you want to name it as
> >btthreadstack, right? Since I didn't get at all why it's related to
> >thread_struct except of getting 'sp'.
> >
>
> The name is based on what is passed into the function. You do a
> backtrace when given a thread structure. In my experience it is
> best to name functions based upon how the function's user sees it.
> Though I'm not stuck on the name, if you would prefer btthreadstack.
About the name, in fact a task struct is passed in. Mainly there's a
thread_struct defined in x86 ARCH, I thought you are handling
thread_struct related things when I look at the first glance.
btthreadstack is far better name that that, I like it.
******************************
arch/x86/include/asm/processor.h
struct thread_struct {
/* Cached TLS descriptors: */
struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
unsigned long sp0;
unsigned long sp;
#ifdef CONFIG_X86_32
unsigned long sysenter_cs;
#else
......
}
Thanks
Baoquan
>
> >>>+ set var $pid_task = $arg0
> >>>+
> >>>+ printf "\npid %d; comm %s:\n", $pid_task.pid, $pid_task.comm
> >>>+ printf "task struct: "
> >>>+ print $pid_task
> >>>+ printf "===================\n"
> >>>+ set var $stackp = $pid_task.thread.sp
> >>>+ set var $stack_top = ($stackp & ~4095) + 4096
> >>>+ set var $stack_bot = ($stackp & ~4095)
> >>>+
> >>>+ set $stackp = *((unsigned long *) $stackp)
> >>>+ while (($stackp < $stack_top) && ($stackp > $stack_bot))
> >>>+ set var $addr = *(((unsigned long *) $stackp) + 1)
> >>>+ info symbol $addr
> >>>+ set $stackp = *((unsigned long *) $stackp)
> >>>+ end
> >>>+end
> >>>+document btthreadstruct
> >>>+ dump a thread stack using the given task structure pointer
> >>>+end
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Baoquan He <bhe@redhat.com> - 2016-05-09 07:20 +0200
Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Corey Minyard <minyard@acm.org> - 2016-05-09 14:20 +0200
Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Baoquan He <bhe@redhat.com> - 2016-05-09 16:40 +0200
Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Corey Minyard <cminyard@mvista.com> - 2016-05-09 17:50 +0200
Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Baoquan He <bhe@redhat.com> - 2016-05-10 03:40 +0200
Re: [PATCH] kdump: Fix gdb macros work work with newer and 64-bit kernels Baoquan He <bhe@redhat.com> - 2016-05-10 03:50 +0200
csiph-web